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 num = min(g // 500, a) if num > 0: if dfs(a-num, b, c, d, e, f, g-500*num): return True num = min(g // 100, b) if num > 0: if dfs(a, b-num, c, d, e, f, g-100*num): return True num = min(g // 50, c) if num > 0: if dfs(a, b, c-num, d, e, f, g-50*num): return True num = min(g // 10, d) if num > 0: if dfs(a, b, c, d-num, e, f, g-10*num): return True num = min(g // 5, e) if num > 0: if dfs(a, b, c, d, e-num, f, g-5*num): return True num = min(g // 1, f) if num > 0: 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')