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