N, x = map(int,input().split())

a = sorted(map(int,input().split()))

count = 0

for y in a:
    ama = x -y
    if ama >0:
        count += 1

if count == 0:
    print(0)

else:
    print(count) if sum(a) == x else print(count-1)