#include <iostream> using namespace std; int main() { int m,k,c=0; cin>>m>>k; if(m%19==0) { while(m!=0) { if(m%10==3) c++; m=m/10; } if(c==k) cout<<"YES"<<endl; else cout<<"NO"<<endl; } else cout<<"NO"<<endl; return 0; }