N,x = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
ans = 0
judge = [False for i in range(N)]
# print(judge)
for i in range(N):
    if x-a[i]>=0:
        judge[i]=True

temp_count=0
for i in range(N):
    if judge[i]:
        temp_count+=1
if sum(a)<x:
    print(temp_count-1)
else:
    print(temp_count)
