#include using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, x, y, z; cin >> n >> x >> y >> z; multiset ms; for (int i = 0; i < n; i++) { int a; cin >> a; ms.emplace(a); } while (z && !ms.empty()) { auto w = *ms.rbegin(); ms.erase(ms.find(w)); if (w < 10000) { z--; continue; } int m = min(z, w / 10000); w -= m * 10000; z -= m; ms.emplace(w); } while (y && !ms.empty()) { auto w = *ms.rbegin(); ms.erase(ms.find(w)); if (w < 5000) { y--; continue; } int m = min(y, w / 5000); w -= m * 5000; y -= m; ms.emplace(w); } while (x && !ms.empty()) { auto w = *ms.rbegin(); ms.erase(ms.find(w)); if (w < 1000) { x--; continue; } int m = min(x, w / 1000); w -= m * 1000; x -= m; ms.emplace(w); } if (ms.empty()) cout << "Yes\n"; else cout << "No\n"; return 0; }