#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector > money {{10000, 0}, {5000, 0}, {1000, 0}}; for (int i = 2; i >= 0; i--) cin >> money[i].second; priority_queue q; for (int i = 0; i < n; i++) { int a; cin >> a; q.push(a); } for (auto &[k, v]: money) { while (v > 0 && q.size()) { int x = q.top(); if (k > x) { --v; q.pop(); } else { int c = min(x / k, v); v -= c; x -= c * k; q.pop(); q.push(x); } } } if (q.empty()) cout << "Yes" << endl; else cout << "No" << endl; return 0; }