N,X,Y,Z = map(int,input().split()) A = list(map(int,input().split())) for i in range(N): if A[i]>=10000 and Z > 0: temp = min(A[i]//10000,Z) A[i]-=temp*10000 Z-=temp A.sort() A = A[:len(A)-Z] for i in range(len(A)): if A[i]>=5000 and Y > 0: temp = min(A[i]//5000,Y) A[i]-=temp*5000 Y-=temp A.sort() A = A[:len(A)-Y] for i in range(len(A)): X-=A[i]//1000+1 if X>=0: print('Yes') else: print('No')