#include<bits/stdc++.h> using namespace std; int main(){ int m,k,cnt=0; cin>>m>>k; while(m!=0){ if(m%10==3)cnt++; m/=10; } if(cnt==k)cout<<"YES"; else cout<<"NO"; return 0; }