import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int oddSum = 0;
int evenSum = 2;
while(n != 0){
int remain = n % 10;
if(remain % 2 == 0){
evenSum = evenSum + remain;
}
else{
oddSum =oddSum+ remain;
}
n /= 10;
}
if(oddSum % 3 == 0 || evenSum % 4 == 0){
System.out.println("Yes");
}
else{
System.out.println("No");
}
}
}