#include #include using namespace std; int A, B, C, D, E, F, G; int main(void) { cin >> A >> B >> C >> D >> E >> F >> G; for(int a = 0; a <= A; a++){ for(int b = 0; b <= B; b++){ for(int c = 0; c <= C; c++){ for(int d = 0; d <= D; d++){ for(int e = 0; e <= E; e++){ for(int f = 0; f <= F; f++){ if(a*500+b*100+c*50+d*10+e*5+f == G){ cout << "YES" << endl; return 0; } } } } } } } cout << "NO" << endl; return 0; }