#include main(){int t=0,f=0;char c='0';while(c!=EOF){if(c>='0')t=(t+c-'0')%3;f=(c-'0')%2;c=getchar();}printf("%s\n",(f+t?"No":"Yes"));}