A, B, C, D, E, F, G = map(int, input().split()) L = [] for a in range(A+1): for b in range(B+1): for c in range(C+1): for d in range(D+1): for e in range(E+1): for f in range(F+1): L += [500*a + 100*b + 50*c + 10*d + 5*e + f] print(['NO', 'YES'][G in L])