#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define range(a) a.begin(), a.end() int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); ll N, X, Y, Z; cin >> N >> X >> Y >> Z; vector A(N); rep(i, N) cin >> A[i]; rep(i, N) { ll use = min(Z, A[i] / 10000); Z -= use; A[i] -= 10000 * use; } sort(A.rbegin(), A.rend()); rep(i, N) { if (Z > 0 && 0 <= A[i] && A[i] < 10000) { A[i] -= 10000; Z--; } } rep(i, N) if (A[i] >= 0) { ll use = min(Y, A[i] / 5000); Y -= use; A[i] -= 5000 * use; } rep(i, N) { if (Y > 0 && 0 <= A[i] && A[i] < 5000) { A[i] -= 5000; Y--; } } rep(i, N) if (A[i] >= 0) { ll use = min(X, A[i] / 1000); X -= use; A[i] -= 1000 * use; if (X > 0 && 0 <= A[i] && A[i] < 1000) { A[i] -= 1000; X--; } } rep(i, N) { if (A[i] >= 0) { cout << "No" << endl; return 0; } } cout << "Yes" << endl; }