n , a = map(int,input().split())
x = list(map(lambda x:int(x)-a,input().split()))
dp = [0 for i in range(4901)]
for i in x:
    if i < 0:
        for j in range(4901):
            if 0<=i+j<=4900:
                dp[j+i] += dp[j]
    elif i >= 0:
        for j in reversed(range(4901)):
            if 0<=i+j<=4900:
                dp[j+i] += dp[j]
    dp[i+2450] += 1
print(dp[2450])