A,B,C,D,E,F,G=map(int,input().split()) Coin=[500,100,50,10,5,1] #print(F,G) 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): #print(a,b,c,d,e,f) if a*500+b*100+c*50+d*10+e*5+f*1==G: print("YES") exit() print("NO")