#include using namespace std; using ll = long long; template using Pa = pair; template using vec = vector; template using vvec = vector>; int main(){ cin.tie(0); ios::sync_with_stdio(false); int N; vec X(3); cin >> N >> X[0] >> X[1] >> X[2]; vec B = {1000,5000,10000}; vec A(N); bool ok = true; for(int i=0;i> a; for(int j=2;j>=0;j--){ if(B[j]>=a){ int n = min(a/B[j],X[j]); a -= n*B[j]; X[j] -= n; } if(j!=0 && B[j]>0 && B[j]>a && a>B[j-1]){ B[j]--; a = -1; } } if(a==-1){ for(int j=0;j<3;j++) if(X[j]){ X[j]--; a = -1; break; } } ok &= a==-1; } cout << (ok? "Yes\n":"No\n"); }