A, B, C, D, E, F, G = map(int, input().split()) G -= 500 * min(G//500, A) G -= 100 * min(G//100, B) G -= 50 * min(G// 50, C) G -= 10 * min(G// 10, D) G -= 5 * min(G// 5, E) G -= 1 * min(G// 1, F) print(['NO', 'YES'][G == 0])