#include using namespace std; #define _overload3(_1,_2,_3,name,...) name #define _rep(i,n) repi(i,0,n) #define repi(i,a,b) for(int i=int(a);i P; const ll INF = 1LL<<60; ll gcd(ll a, ll b) { if(b == 0) return a; return gcd(b, a % b); } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } ll modpow(ll a, ll n, ll mod) { ll res = 1; while (n > 0) { if (n & 1) res = res * a % mod; a = a * a % mod; n >>= 1; } return res; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; ll X, Y, Z; cin >> N >> X >> Y >> Z; vector A(N); rep(i, N) cin >> A[i]; sort(A.rbegin(), A.rend()); int cnt_0 = 0; rep(i, N){ ll gaku = A[i]; if(gaku > 5000){ ll cnt_Z = min((gaku + 10000 - 1) / 10000, Z); gaku -= 10000 * cnt_Z; Z -= cnt_Z; } if(gaku == 0){ cnt_0++; continue; } if(gaku < 0) continue; if(gaku > 1000){ ll cnt_Y = min((gaku + 5000 - 1) / 5000, Y); gaku -= 5000 * cnt_Y; Y -= cnt_Y; } if(gaku == 0){ cnt_0++; continue; } if(gaku < 0) continue; ll cnt_X = min((gaku + 1000 - 1)/1000, X); gaku -= 1000 * cnt_X; X -= cnt_X; if(gaku == 0){ cnt_0++; continue; } if(gaku < 0) continue; // ll cnt_Y = min(gaku / 5000 + 1, Y); // gaku -= 5000 * cnt_Y; // Y -= cnt_Y; // if(gaku < 0) continue; // ll cnt_Z = min(gaku / 10000 + 1, Z); // gaku -= 10000 * cnt_Z; // Z -= cnt_Z; // if(gaku < 0) continue; cout << "No" << endl; return 0; } if(cnt_0 <= (X+Y+Z)){ cout << "Yes" << endl; }else{ cout << "No" << endl; } return 0; }