#include #include using namespace std; using namespace atcoder; using ll = long long int; using ld = long double; const ll MAX = 5000000000000000000; const ld PI = 3.14159265358979; const ll MOD = 0;//2024948111; ld dotorad(ld K){return PI * K / 180.0;} ld radtodo(ld K){return K * 180.0 / PI;} mt19937 mt; void randinit(){srand((unsigned)time(NULL));mt = mt19937(rand());} int main(){ ll N,X,Y,Z; cin >> N >> X >> Y >> Z; vector A(N); for(ll i = 0;i < N;i++){ ll a; cin >> a; A[i] = (a / 1000) * 1000 + 1000; } sort(A.begin(),A.end(),greater()); for(ll i = 0;i < N;i++){ ll p = A[i] / 10000; p = min(p,Z); Z -= p; A[i] -= 10000 * p; } if(Z != 0){ sort(A.begin(),A.end(),greater()); for(ll i = 0;i < N;i++){ if(Z != 0){ A[i] = 0; Z--; } } } sort(A.begin(),A.end(),greater()); for(ll i = 0;i < N;i++){ ll p = A[i] / 5000; p = min(p,Y); Y -= p; A[i] -= 5000 * p; } if(Y != 0){ sort(A.begin(),A.end(),greater()); for(ll i = 0;i < N;i++){ if(Y != 0){ A[i] = 0; Y--; } } } sort(A.begin(),A.end(),greater()); for(ll i = 0;i < N;i++){ ll p = A[i] / 1000; p = min(p,X); Y -= p; A[i] -= 1000 * p; } if(X != 0){ sort(A.begin(),A.end(),greater()); for(ll i = 0;i < N;i++){ if(X != 0){ A[i] = 0; X--; } } } ll a = 0; for(ll i = 0;i < N;i++) a += A[i]; if(a == 0) cout << "Yes" << endl; else cout << "No" << endl; }