#include #define rep(i, n) for(int i=0; i<(n); ++i) #define rep2(i, s, n) for(int i=s; i<(n); ++i) #define ALL(v) (v).begin(), (v).end() using namespace std; typedef long long ll; template using priority_queue_rev = priority_queue, greater >; static const int INTINF = (2147483647 >> 1); // 10^9 + 5000 static const ll LLINF = (9223372036854775807 >> 1); static const int MAX = 1e5+1; static const ll MOD = 1e9+7; namespace Kunitaka{ template< typename TYPE, std::size_t SIZE > std::size_t array_length(const TYPE (&array)[SIZE]) { return SIZE; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } } using namespace Kunitaka; namespace Printer{ void br(){ cout << endl; } void loop_cnt(int i){ cout << "i = " << i << endl; } void loop_cnt(int i, int j){ cout << "i = " << i << ", " << "j = " << j << endl; } template void print(T x){ cout << x << endl; } template void print(T x, S y){ cout << x << "," << y << endl; } template void print(T x, S y, U z){ cout << x << "," << y << "," << z << endl; } template void print(pair p){ cout << p.first << ", " << p.second << endl; } template< typename TYPE, std::size_t SIZE > void print(const TYPE (&array)[SIZE]){ int lim = array_length(array); for(int i=0; i void print(vector v){ for(int i=0; i void print(vector > vv){ for(int i=0; i> N >> X >> Y >> Z; ll all_cnt = X + Y + Z; vector A(N); rep(i, N) cin >> A[i]; sort(ALL(A), greater()); rep(i, N){ ll nokori_cnt = all_cnt - i - 1; ll cnt1 = gausu(A[i], 1000); if(X >= cnt1 && all_cnt - cnt1 >= nokori_cnt){ X -= cnt1; continue; } ll cnt2 = gausu(A[i], 5000); if(Y >= cnt2 && all_cnt - cnt2 >= nokori_cnt){ Y -= cnt2; continue; } ll cnt3 = gausu(A[i], 10000); if(Z >= cnt1 && all_cnt - cnt1 >= nokori_cnt){ Z -= cnt1; continue; } cout << "No" << endl; return 0; } cout << "Yes" << endl; return 0; }