#include using namespace std; int main() { int A, B, C, D, E, F, G, a; cin >> A >> B >> C >> D >> E >> F >> G; if (500 * A < G) a = 500 * A; else a = G / 500 * 500; if (100 * B < G - a) a += 100 * B; else a += (G - a) / 100 * 100; if (50 * C < G - a) a += 50 * C; else a += (G - a) / 50 * 50; if (10 * D < G - a) a += 10 * D; else a += (G - a) / 10 * 10; if (5 * E < G - a) a += 5 * E; else a += (G - a) / 5 * 5; if (F < G - a) a += F; else a += G - a; if (G == a) cout << "YES"; else cout << "NO"; }