a[37],s,n;main(long i){for(;i=0,gets(&i);a[i%37]+=!!s++);for(;++i<37;n+=a[i]*2>s);n=!puts(n?"NO":"YES");}