from sys import stdin ## input functions for me def ria(sep = ''): if sep == '' : return list(map(int, input().split())) else: return list(map(int, input().split(sep))) def rsa(sep = ''): if sep == '' : return input().split() else: return input().split(sep) def ri(): return int(input()) def rd(): return float(input()) def rs(): return input() ## ## main ## A, B, C, D, E, F, G = map(int, rsa()) ret = "NO" for a in range(0,A+1): for b in range(0,B+1): for c in range(0,C+1): for d in range(0,D+1): for e in range(0,E+1): rest = G - (500 * a - 100 * b + 50 * c + 10 * d + 5 * e) if rest == F : ret = "YES" print (ret)