#include using namespace std; int main(){ int N, X, Y, Z; cin >> N >> X >> Y >> Z; vector A(N); sort(A.begin(), A.end()); reverse(A.begin(), A.end()); for (int i = 0; i < N; i++){ cin >> A[i]; A[i] = (A[i] + 1000) / 1000; } long long total = 0; for (int i = 0; i < N; i++){ total += A[i]; } if (total > X + Y * 5 + Z * 10){ cout << "No" << endl; } else { bool flg = true; int a = 0, b = 0, c = 0; for (int i = 0; i < N; i++){ int pa = a, pb = b; a += A[i]; if (a > X){ b += (a - X + 4) / 5; a -= (a - X + 4) / 5 * 5; if (a < pa){ a = pa; } } if (b > Y){ c += (b - Y + 1) / 2; b -= (b - Y + 1) / 2 * 2; if (b < pb){ b = pb; } } if (c > Z){ flg = false; } cout << "a = " << a << ", b = " << b << ", c = " << c << endl; } if (flg){ cout << "Yes" << endl; } else { cout << "No" << endl; } } }