#include // clang-format off using Int = long long; #define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++) #define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__) struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout << std::fixed << std::setprecision(13); } } setup_io; #ifndef _MY_DEBUG #define dump(...) #endif // clang-format on /** * author: knshnb * created: Mon Apr 6 16:02:49 JST 2020 **/ signed main() { Int n, x, y, z; std::cin >> n >> x >> y >> z; std::priority_queue pq; REP(i, n) { Int a; std::cin >> a; pq.push(a + 1); } while (pq.size()) { Int a = pq.top(); pq.pop(); if (z > 0) { if (a < 10000) { z--; } else { Int use = std::min(z, a / 10000); z -= use, a -= use * 10000; pq.push(a); } } else if (y > 0) { if (a < 5000) { y--; } else { Int use = std::min(y, a / 5000); y -= use, a -= use * 5000; pq.push(a); } } else { pq.push(a); break; } } while (pq.size()) { x -= (pq.top() + 999) / 1000; pq.pop(); } std::cout << (x >= 0 ? "Yes" : "No") << std::endl; }