*a,g = map(int,input().split()) from itertools import product money = [500,100,50,10,5,1] for lst in product(*(range(ai+1) for ai in a)): if sum(i*j for i,j in zip(lst,money)) == g: print("YES") exit() print("NO")