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