A,B,C,D,E,F,G = map(int,input().split()) for i in range(A+1): for j in range(B+1): for k in range(C+1): for l in range(D+1): for m in range(E+1): for n in range(F+1): if G == (500*i+100*j+50*k+10*l+5*m+n): print('YES') exit() print('NO')