#include using namespace std; typedef pair P; typedef long long ll; typedef long double ld; const int inf=1e9+7; const ll longinf=1LL<<60; #define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i ) #define rep(i,n) REP(i,0,n) #define F first #define S second const int mx=8010; const ll mod=1e9+7; int main(){ int n; ll x,y,z; cin >> n >> x >> y >> z; vector a(n); rep(i,n) cin>>a[i]; rep(i,n){ ll k = a[i]/10000; a[i] %= 10000; if(a[i]==0) a[i]++; if(z>=k){ z -= k; } else { k -= z; z=0; a[i] += 10000*k; } } sort(a.rbegin(),a.rend()); rep(i,n){ ll k = a[i]/10000; a[i] %= 10000; if(a[i]==0) a[i]++; if(z>=k){ z -= k; } else { k -= z; z=0; a[i] += 10000*k; } k = a[i]/5000; a[i] %= 5000; if(a[i]==0) a[i]++; if(y>=k){ y -= k; } else { k -= y; y=0; a[i] += 5000*k; } k = (a[i]+999)/1000; if(x>=k){ x -= k; } else { // k -= x; // a[i] -= 1000*x; // x=0; if(a[i]%10000<=5000 && y>0){ y--; a[i] -= 5000; if(a[i]<=0) continue; } k = (a[i]+9999)/10000; if(z>=k){ z -= k; } else { a[i] -= 10000*z; z=0; k = (a[i]+4999)/5000; if(y>=k){ y -= k; } else { a[i] -= 5000*y; y=0; k = (a[i]+999)/1000; if(x>=k){ x -= k; } else { cout << "No" << endl; return 0; } } } } } cout << "Yes" << endl; return 0; }