#include using namespace std; #define ll long long int main() { int N, X, Y, Z; cin >> N >> X >> Y >> Z; vector A(N); for (int i = 0; i < N; i++) { cin >> A[i]; A[i]++; A[i] = (A[i]+999)/1000; if (A[i]%10 > 0) { if (A[i]%10 >= 5) { if (Y >= 1 && X >= A[i]%5) { Y--; X -= A[i]%5; A[i] -= A[i]%10; }else if (X >= A[i]%10) { X -= A[i]%10; A[i] -= A[i]%10; } }else if (A[i]%10 > 0) { if (X >= A[i]%10) { X -= A[i]%10; A[i] -= A[i]%10; }else if (Y >= 1) { Y--; A[i] -= A[i]%10; } } } A[i] = (A[i]+9)/10*10; if (A[i] <= 10*Z) { Z -= A[i]/10; }else { A[i] -= Z; Z = 0; if (A[i] <= 5*Y) { Y -= A[i]/5; }else { A[i] -= Y*5; Y = 0; if (A[i] <= X) { X -= A[i]; }else { cout << "No\n"; return 0; } } } } cout << "Yes\n"; return 0; }