#include using namespace std; using ll = long long; bool solve(int n, ll x, ll y, ll z, vector& a) { sort(a.begin(), a.end(), greater<>()); for (int i = 0; i < n; ++i) { ll tmp = min(a[i] / 10000, z); z -= tmp; a[i] -= tmp * 10000; } sort(a.begin(), a.end(), greater<>()); for (int i = 0; i < n; ++i) { ll tmp = min(a[i] / 5000, y); y -= tmp; a[i] -= tmp * 5000; } sort(a.begin(), a.end(), greater<>()); for (int i = 0; i < n; ++i) { if (a[i] >= 0) { if (z <= 0) break; a[i] -= 10000; --z; } } for (int i = 0; i < n; ++i) { if (a[i] >= 0) { if (y <= 0) break; a[i] -= 5000; --y; } } for (int i = 0; i < n; ++i) { if (a[i] >= 0) { x -= a[i] / 1000 + 1; a[i] = -1; } } if (x < 0) return false; for (int i = 0; i < n; ++i) { if (a[i] >= 0) return false; } return true; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; ll x, y, z; cin >> n >> x >> y >> z; vector a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } cout << (solve(n, x, y, z, a) ? "Yes" : "No") << "\n"; return 0; }