#include using namespace std; using i64 = long long; #define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++) #define all(x) x.begin(),x.end() template static inline std::vector ndvec(size_t&& n, T val) noexcept { return std::vector(n, std::forward(val)); } template static inline auto ndvec(size_t&& n, Tail&&... tail) noexcept { return std::vector(tail)...))>(n, ndvec(std::forward(tail)...)); } template struct chain { Cond cond; chain(Cond cond) : cond(cond) {} bool operator()(T& a, const T& b) const { if(cond(a, b)) { a = b; return true; } return false; } }; template chain make_chain(Cond cond) { return chain(cond); } int main() { i64 N, X, Y, Z; cin >> N >> X >> Y >> Z; vector A(N); rep(i,0,N) { cin >> A[i]; A[i] = A[i] / 1000 + 1; } rep(i,0,N) { i64 n = A[i] / 10; if(n <= Z) { Z -= n; } else if(n * 10 <= Y * 5 + X) { i64 y = std::min(Y, n * 2); Y -= y; X -= n * 10 - y * 5; } else { std::cout << "No" << endl; return 0; } A[i] %= 10; } sort(all(A)); rep(i,0,N) { if(A[i] >= 5) { if(Y > 0) { Y--; A[i] -= 5; } else if(Z > 0) { Z--; A[i] = 0; } } } sort(all(A)); reverse(all(A)); rep(i,0,N) { if(A[i] > 0) { if(Y > 0) { Y--; A[i] = 0; } else if(Z > 0) { Z--; A[i] = 0; } else if(A[i] <= X) { X -= A[i]; A[i] = 0; } else { cout << "No" << endl; return 0; } } } cout << "Yes" << endl; }