#include #include #include using namespace std; #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define all(a) a.begin(),a.end() #define rall(c) (c).rbegin(),(c).rend() #define mp make_pair typedef long long ll; typedef pair pii; typedef pair pll; typedef long double ld; const ll inf=1e9+7; const ll mod=1e9+7; int main(){ ll n,x,y,z;cin>>n>>x>>y>>z; bool f=1; rep(i,n){ ll a;cin>>a; if(x==0&&y==0&&z==0)f=0; a=(a/1000+1)*1000; if(a%5000){ if(a%5000<=x*1000){ x-=(a%5000)/1000; a-=a%5000; }else{ if(a%5000)a=((a-1)/5000+1)*5000; } } if(a%10000){ if(a%10000<=y*5000){ y-=(a%10000)/5000; a-=a%10000; }else if(a%10000<=x*1000){ x-=(a%10000)/1000; a-=a%10000; }else{ a=((a)/10000+1)*10000; } } if(a/10000<=z){ z-=a/10000; a=0; }else{ a-=z*10000; z=0; } if(a/5000<=y){ y-=a/5000; a=0; }else{ a-=y*5000; y=0; } if(a/1000<=x){ x-=a/1000; a=0; }else{ a-=x*1000; x=0; } if(a)f=0; } if(f)cout<<"Yes"<