#include using namespace std; int main(int argc, char *argv[]) { int A, B, C, D, E, F, G; cin >> A >> B >> C >> D >> E >> F >> G; 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++) { int sum = 500 * A + 100 * B + 50 * C + 10 * D + 5 * E + 1 * F; if (sum == G) { cout << "YES" << endl; return 0; } } } } } } } cout << "NO" << endl; return 0; }