# coding: utf-8 N, X, Y, Z = map(int, input().split()) A = list(map(int, input().split())) for i in range(N): v = A[i] # t = v // 10000 # Z -= t # v %= 10000 # t = v // 5000 # Y -= t # v %= 5000 while v > 0: if v <= 1000: v -= 1000 X -= 1 continue elif v <= 5000: v -= 5000 Y -= 1 continue elif v <= 10000: v -= 10000 Z -= 1 continue else: break # if X >= 0 and Y >= 0 and Z >= 0: if X * 1000 + Y * 5000 + Z * 10000 >= 0: print("Yes") else: print("No")