n,x,y,z = map(int,input().split()) A = list(map(int,input().split())) for i,a in enumerate(A): A[i] = (a//1000 + 1)*1000 A.sort(reverse = True) for i,a in enumerate(A): if a >= 10000: if z >= a//10000: z -= a//10000 A[i] %= 10000 else: A[i] -= z * 10000 z = 0 break else: break A.sort(reverse = True) for i,a in enumerate(A): if a == 0: break if z > 0: z -= 1 A[i] = 0 elif a >= 5000: if y >= a//5000: y -= a//5000 A[i] %= 5000 else: A[i] -= y * 5000 y = 0 break else: break A.sort(reverse = True) for i,a in enumerate(A): if a == 0: break if z > 0: z -= 1 A[i] = 0 elif y > 0: y -= 1 A[i] = 0 elif x > 0: x -= (a-1)//1000 + 1 else: print('No') exit(0) print('Yes')