#include #include #include #include #include #include #include using namespace std; typedef long long ll; ll N, X, Y, Z; ll A[100000]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; cin >> N >> Z >> Y >> X; for(int i = 0; i < N; i++) cin >> A[i]; for(int i = 0; i < N; i++) { ll m = min(A[i]/10000, X); A[i] -= (m*10000); X -= m; } // cout << X << ' ' << Y << ' ' << Z << endl; sort(A, A+N, greater()); for(int i = 0; i < N; i++) { if(X > 0){ ll m = min(X, (A[i])/10000+1); X -= m; A[i] -= m*10000; } if(Y > 0 && A[i] >= 0){ ll m = min(Y, (A[i])/5000+1); Y -= m; A[i] -= m*5000; } } for(int i = 0; i < N; i++) { if(A[i] <= 0) continue; ll m = min(A[i]/5000, Y); A[i] -= (m*5000); Y -= m; } // cout << X << ' ' << Y << ' ' << Z << endl; sort(A, A+N, greater()); for(int i = 0; i < N; i++) { if(Y > 0 && A[i] >= 0){ ll m = min(Y, (A[i])/5000+1); Y -= m; A[i] -= m*5000; } if(Z > 0 && A[i] >= 0){ ll m = min(Z, (A[i])/1000+1); Z -= m; A[i] -= m*1000; } if(A[i] >= 0){ cout << "No" << endl; return 0; } } cout << "Yes" << endl; }