#include #define rep(i,n) for(int i=0;i<(int)(n);i++) #define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++) #define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++) #define setp(n) fixed << setprecision(n) template bool chmax(T &a, const T &b) { if (a bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; } #define ll long long #define vll vector #define vi vector #define pll pair #define pi pair #define all(a) (a.begin()),(a.end()) #define rall(a) (a.rbegin()),(a.rend()) #define fi first #define se second #define pb push_back #define mp make_pair #define ins insert using namespace std; /* Some Libraries */ //------------------------------------------------- int main(void) { cin.tie(0); ios::sync_with_stdio(false); int n; ll x,y,z; cin>>n>>x>>y>>z; vll a(n); rep(i,n) cin>>a[i]; vll b(n); rep(i,n) b[i]=(a[i]+1000)/1000; // 10 sort(rall(b)); rep(i,n){ ll c = b[i]/10; if (z<=c){ b[i]-=z*10; z=0; break; }else{ b[i]-=c*10; z-=c; } } sort(all(b)); rep(i,z) b.pop_back(); reverse(all(b)); n = b.size(); // 5 rep(i,n){ ll c = b[i]/5; if (y<=c){ b[i]-=y*5; y=0; break; }else{ b[i]-=c*5; y-=c; } } sort(all(b)); rep(i,y) b.pop_back(); reverse(all(b)); n = b.size(); // 1 ll sum=0; rep(i,n) sum+=b[i]; if (sum<=x){ cout<<"Yes\n"; }else{ cout<<"No\n"; } return 0; }