a, b, c, d, e, f, g = [ int(v) for v in input().split() ] money = [ 500*i + 100*j + 50*k + 10*l + 5*m + n 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) ] print( "YES" if g in money else "NO")