#include using namespace std; int main(){ int A, B, C, D, E, F, G; cin >> A >> B >> C >> D >> E >> F >> G; bool ok = false; for (int i = 0; i <= A; i++){ for (int j = 0; j <= B; j++){ for (int k = 0; k <= C; k++){ for (int l = 0; l <= D; l++){ for (int m = 0; m <= E; m++){ for (int n = 0; n <= F; n++){ if (i * 500 + j * 100 + k * 50 + l * 10 + m * 5 + n == G){ ok = true; } } } } } } } if (ok){ cout << "YES" << endl; } else { cout << "NO" << endl; } }