#include using namespace std; #define fs first #define sc second #define pb push_back #define mp make_pair #define eb emplace_back #define ALL(A) A.begin(),A.end() #define RALL(A) A.rbegin(),A.rend() typedef long long LL; typedef pair P; 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; } template T gcd(T a,T b){return b?gcd(b,a%b):a;} const LL mod=1000000007; const LL LINF=1LL<<62; const int INF=1<<30; int dx[]={1,0,-1,0,1,-1,1,-1}; int dy[]={0,1,0,-1,1,-1,-1,1}; bool solve(){ int n;cin >> n; vector x(3,0); cin >> x[0] >> x[1] >> x[2]; priority_queue pq; for (int i = 0; i < n; i++) { LL a;cin >> a; pq.push(a); } while(not pq.empty()){ if(x[2]){ LL t = pq.top();pq.pop(); LL c = t / 10000; if(c == 0) c = 1; if(c <= x[2]){ x[2] -= c; t -= 10000 * c; if(t >= 0) pq.push(t); } else{ t -= 10000 * x[2]; x[2] = 0; if(t >= 0) pq.push(t); } } else if(x[1]){ LL t = pq.top();pq.pop(); LL c = t / 5000; if(c == 0) c = 1; if(c <= x[1]){ x[1] -= c; t -= 5000 * c; if(t >= 0) pq.push(t); } else{ t -= 5000 * x[1]; x[1] = 0; if(t >= 0) pq.push(t); } } else if(x[0]){ LL t = pq.top();pq.pop(); LL c = t / 1000; if(c == 0) c = 1; if(c <= x[0]){ x[0] -= c; t -= 1000 * c; if(t >= 0) pq.push(t); } else{ t -= 1000 * x[0]; x[0] = 0; if(t >= 0) pq.push(t); } } else{ return false; } } return true; } int main(){ if(solve()) puts("Yes"); else puts("No"); return 0; }