#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef uint64_t ull; typedef pair P; typedef pair Pid; typedef pair Pdi; typedef pair Pl; typedef pair Pll; typedef pair> PP; typedef pair PPi; constexpr double PI = 3.1415926535897932; // acos(-1) constexpr double EPS = 1e-9; constexpr int INF = 1001001001; constexpr int mod = 1000000007; // constexpr int mod = 998244353; #define chmax(x, y) x = max(x, y) #define chmin(x, y) x = min(x, y) #define chadd(x, y) x = (x + y) % mod int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n, x, y, z; cin >> n >> x >> y >> z; vector a(n); for(int i = 0; i < n; ++i) cin >> a[i], ++a[i]; sort(a.begin(), a.end(), greater()); for(int i = 0; i < n; ++i){ int need = a[i] / 10000; if(need <= z){ a[i] -= need * 10000; z -= need; } else{ a[i] -= z * 10000; z = 0; break; } } sort(a.begin(), a.end(), greater()); for(int i = 0; i < n; ++i){ int need = ceil((double)a[i] / 10000); if(need <= z){ a[i] = 0; z -= need; } else{ a[i] -= z * 10000; z = 0; break; } } sort(a.begin(), a.end(), greater()); for(int i = 0; i < n; ++i){ int need = a[i] / 5000; if(need <= y){ a[i] -= need * 5000; y -= need; } else{ a[i] -= y * 5000; y = 0; break; } } sort(a.begin(), a.end(), greater()); for(int i = 0; i < n; ++i){ int need = ceil((double)a[i] / 5000); if(need <= y){ a[i] = 0; y -= need; } else{ a[i] -= y * 5000; y = 0; break; } } sort(a.begin(), a.end(), greater()); for(int i = 0; i < n; ++i){ int need = a[i] / 1000; if(need <= x){ a[i] -= need * 1000; x -= need; } else{ a[i] -= x * 1000; x = 0; break; } } sort(a.begin(), a.end(), greater()); for(int i = 0; i < n; ++i){ int need = ceil((double)a[i] / 1000); if(need <= x){ a[i] = 0; x -= need; } else{ a[i] -= x * 1000; x = 0; break; } } for(int i = 0; i < n; ++i){ if(a[i] > 0){ cout << "No\n"; return 0; } } cout << "Yes\n"; }