#include using namespace std; int main(){ 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 x = 0;x <= e;x++){ for(int y = 0;y <= f;y++){ int ans = i*500 + j*100 + k*50 + l*10 + x*5 + y; if(ans == g){ cout << "YES" << endl; return 0; } } } } } } } cout << "NO" << endl; return 0; }