def main(): A, B, C, D, E, F, G = map(int, input().split()) saifu = [[500, A], [100, B], [50, C], [10, D], [5, E], [1, F]] for coin in saifu: if not coin[1]: continue if G > coin[0] * coin[1]: G -= coin[0] * coin[1] continue if G % coin[0] == 0: print("YES") return G %= coin[0] else: print("NO") if __name__ == "__main__": main()