#include using namespace std; //conversion //------------------------------------------ inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;} template inline string toString(T x) {ostringstream sout;sout< inline T sqr(T x) {return x*x;} //typedef //------------------------------------------ typedef long long LL; typedef pair PII; typedef pair PLL; typedef map MII; typedef queue QI; typedef queue QPII; typedef stack SI; typedef stack SPII; typedef deque DI; typedef vector VI; typedef vector VVI; typedef vector VLL; typedef vector VVLL; typedef vector VB; typedef vector VVB; typedef vector VD; typedef vector VVD; typedef vector VS; typedef vector VVS; typedef vector VC; typedef vector VVC; typedef vector VPII; typedef vector VPLL; typedef priority_queue PQGI; //大きい順 typedef priority_queue> PQLI; typedef priority_queue PQGP; typedef priority_queue> PQLP; //container util //------------------------------------------ #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define PF push_front #define POB pop_back() #define POF pop_front() #define MP make_pair #define SZ(a) int((a).size()) #define SQ(a) ((a)*(a)) #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define LB lower_bound #define UB upper_bound #define SORTR(c) sort((c).begin(), (c).end(), greater()) #define NEXP next_permutation #define FI first #define SE second //repetition //------------------------------------------ #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define FORR(i,a,b) for(int i = (b-1);i>=a;i--) #define REPR(i,n) FORR(i,0,n) #define BREP(bit,N) for (int bit = 0; bit < (1<bool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b0){ if(N&1) res = res * A % M; A = A * A % M; N >>= 1; } return res; } LL fac[MAX], finv[MAX], inv[MAX]; void ConInit(LL M) { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % M; inv[i] = M - inv[M%i] * (M / i) % M; finv[i] = finv[i - 1] * inv[i] % M; } } LL COM(int n, int k, LL M){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % M) % M; } void VCout(auto v){ int N = SZ(v); REP(i,N){ cout << v.at(i); if(i == N-1)ENDL; else SPACE; } return; } void Press(auto &v){v.erase(unique(ALL(v)),v.end());} int main() { cin.tie(0); ios::sync_with_stdio(false); SEP(12); LL N,X,Y,Z; cin >> N >> X >> Y >> Z; VLL A(N); REP(i,N){ cin >> A.at(i); A.at(i)++; } SORTR(A); REP(i,N){ if(A.at(i)>=10000){ LL a = A.at(i)/10000; chmin(a,X); A.at(i) -= 10000*a; X -= a; if(X==0) break; } } SORTR(A); if(X>0){ REP(i,N){ A.at(i) = 0; X--; if(X==0) break; } } SORTR(A); REP(i,N){ if(A.at(i)>=5000){ LL a = A.at(i)/5000; chmin(a,Y); A.at(i) -= 5000*a; Y -= a; if(Y==0) break; } else break; } SORTR(A); if(Y>0){ REP(i,N){ A.at(i) = 0; Y--; if(Y==0) break; } } SORTR(A); REP(i,N){ if(A.at(i)>=1000){ LL a = A.at(i)*1000; chmin(a,Z); A.at(i) -= 1000*a; Z -= a; if(Z==0) break; } else break; } SORTR(A); if(Z>0){ REP(i,N){ A.at(i) = 0; Z--; if(Z==0) break; } } LL sum=0; REP(i,N){ sum += A.at(i); } if(sum==0)cYes; else cNo; return 0; }