#include #include #include #include #include #include template inline bool chmin(T &lhs, const U &rhs) { if (lhs > rhs) { lhs = rhs; return true; } return false; } template inline bool chmax(T &lhs, const U &rhs) { if (lhs < rhs) { lhs = rhs; return true; } return false; } // [l, r) from l to r struct range { struct itr { int i; constexpr itr(int i_): i(i_) { } constexpr void operator ++ () { ++i; } constexpr int operator * () const { return i; } constexpr bool operator != (itr x) const { return i != x.i; } }; const itr l, r; constexpr range(int l_, int r_): l(l_), r(std::max(l_, r_)) { } constexpr itr begin() const { return l; } constexpr itr end() const { return r; } }; // [l, r) from r to l struct revrange { struct itr { int i; constexpr itr(int i_): i(i_) { } constexpr void operator ++ () { --i; } constexpr int operator * () const { return i; } constexpr bool operator != (itr x) const { return i != x.i; } }; const itr r, l; constexpr revrange(int l_, int r_): l(l_ - 1), r(std::max(l_, r_) - 1) { } constexpr itr begin() const { return r; } constexpr itr end() const { return l; } }; int main() { int N; long long X, Y, Z; std::cin >> N >> X >> Y >> Z; std::vector A(N); for (long long &x: A) { std::cin >> x; x = x / 1000 + 1; } for (long long &x: A) { int t = x / 10; if (Z > t) { x -= t * 10; Z -= t; } else { x -= Z * 10; Z = 0; } t = x / 5; if (Y > t) { x -= t * 5; Y -= t; } else { x -= Y * 5; Y = 0; } } std::sort(A.rbegin(), A.rend()); for (long long &x: A) { if (Z > 0) { --Z; x = 0; } else if (Y > 0) { --Y; x = 0; } } long long need = std::accumulate(A.begin(), A.end(), 0ll); std::cout << (X >= need ? "Yes" : "No") << '\n'; return 0; }