#include using namespace std; // #define int long long #define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i) #define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i) #define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--) #define rreps(i, n) for (int i = ((int)(n)); i > 0; i--) #define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i) #define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i) #define SORT(v, n) sort(v, v + n); #define REVERSE(v, n) reverse(v, v+n); #define vsort(v) sort(v.begin(), v.end()); #define all(v) v.begin(), v.end() #define mp(n, m) make_pair(n, m); #define cout(d) cout<; using vvi = vector; using vll = vector; using vvll = vector; using pii = pair; using pll = pair; using vs = vector; using vpll = vector>; 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; } const ll INF = 1e15; const int MOD = 1e9+7; const ll LINF = 1e18; signed main() { cin.tie( 0 ); ios::sync_with_stdio( false ); ll n,x,y,z; cin>>n>>x>>y>>z; vll a(n); rep(i,n) cin>>a[i]; sort(a.rbegin(),a.rend()); ll rem=0; rep(i,n){ if(a[i]>10000 && z>0){ ll cnt=min((a[i]+10000-1)/10000, z); a[i]-=10000*cnt; z-=cnt; } if(a[i]>5000 && y>0){ ll cnt=min((a[i]+5000-1)/5000, y); a[i]-=5000*cnt; y-=cnt; } if(a[i]>0 && z>0){ ll cnt=min((a[i]+1000-1)/1000, x); a[i]-=1000*cnt; x-=cnt; } if(a[i]>0){ rem++; } } if(rem>0 && rem>(x+y+z)){ cout<<"No"<