#include using namespace std; #define ll long long int main() { int N; ll X, Y, Z; cin >> N >> X >> Y >> Z; vector A(N); vector> B(N); for (int i = 0; i < N; i++) { cin >> B[i].second; B[i].first = ((B[i].second+1000)/1000)%10; } sort(B.begin(), B.end()); reverse(B.begin(), B.end()); for (int i = 0; i < N; i++) { A[i] = B[i].second; A[i]++; A[i] = (A[i]+999)/1000; if (A[i]%10 > 0) { if (A[i]%10 >= 5) { if (Y >= 1 && X >= A[i]%5) { Y--; X -= A[i]%5; A[i] -= A[i]%10; }else if (X >= A[i]%10) { X -= A[i]%10; A[i] -= A[i]%10; } }else if (A[i]%10 > 0) { if (X >= A[i]%10) { X -= A[i]%10; A[i] -= A[i]%10; }else if (Y >= 1) { Y--; A[i] -= 5; } } } if (A[i] <= 0) continue; if ((A[i]+9)/10 <= Z) { Z -= (A[i]+9)/10; }else { A[i] -= Z*10; Z = 0; if ((A[i]+4)/5 <= Y) { Y -= (A[i]+4)/5; }else { A[i] -= Y*5; Y = 0; if (A[i] <= X) { X -= A[i]; }else { cout << "No\n"; return 0; } } } } cout << "Yes\n"; return 0; }