#include #include #include #include #include #include #include #include #include #include #define mkp make_pair #define mkt make_tuple #define rep(i,n) for(int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const ll MOD=1e9+7; template void chmin(T &a,const T &b){if(a>b) a=b;} template void chmax(T &a,const T &b){if(a>N>>X>>Y>>Z; vector A(N); rep(i,N) cin>>A[i]; vector B(N); rep(i,N) B[i]=A[i]/1000+1; priority_queue PQ; rep(i,N) PQ.push(B[i]); //10,000 while(!PQ.empty()){ if(Z==0) break; auto f=PQ.top(); PQ.pop(); ll num=f/10; if(num==0){ Z--; }else{ if(Z>=num){ Z-=num; if(f%10) PQ.push(f%10); }else{ num-=Z; PQ.push(num*10+f%10); Z=0; } } } //5,000 while(!PQ.empty()){ if(Y==0) break; auto f=PQ.top(); PQ.pop(); ll num=f/5; if(num==0) Y--; else{ if(Y>=num){ Y-=num; if(f%5) PQ.push(f%5); }else{ num-=Y; PQ.push(num*5+f%5); Y=0; } } } ll rest=0; while(!PQ.empty()){ auto f=PQ.top(); PQ.pop(); rest+=f; } if(X>=rest) cout<<"Yes"<