import sys input = sys.stdin.readline sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 # A = [ int(input()) for _ in range(N) ] ############################## A, B, C, D, E, F, G = map(int, input().split()) def dfs(a, b, c, d, e, f, g): if g <= 0: return g == 0 if a > 0: num = min(g // 500, a) if dfs(a-num, b, c, d, e, f, g-500*num): return True if b > 0: num = min(g // 100, b) if dfs(a, b-num, c, d, e, f, g-100*num): return True if c > 0: num = min(g // 50, c) if dfs(a, b, c-num, d, e, f, g-50*num): return True if d > 0: num = min(g // 10, d) if dfs(a, b, c, d-num, e, f, g-10*num): return True if e > 0: num = min(g // 5, e) if dfs(a, b, c, d, e-num, f, g-5*num): return True if f > 0: num = min(g // 1, f) if dfs(a, b, c, d, e, f-num, g-1*num): return True return False print('YES' if dfs(A, B, C, D, E, F, G) else 'NO')