#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i bool chmin(T& a, T b){ if(a > b){a = b; return true;} return false; } template bool chmax(T& a, T b){ if(a < b){a = b; return true;} return false; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int A, B, C, D, E, F, G; cin >> A >> B >> C >> D >> E >> F >> G; rep(a, 0, A+1){ rep(b, 0, B+1){ rep(c, 0, C+1){ rep(d, 0, D+1){ rep(e, 0, E+1){ rep(f, 0, F+1){ 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; }