import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,a = list(map(int, input().split()))
x = list(map(lambda x: int(x)-a, input().split()))
size = max(1, sum(abs(item) for item in x))
# 0: 
dp = [[0]*(2*size+1) for _ in range(n+1)]
dp[0][size+1] = 1
for i in range(1,n+1):
    xx = x[i-1]
    for j in range(2*size+1):
        dp[i][j] = dp[i-1][j]
        if 0<=j-xx<2*size+1:
            dp[i][j] += dp[i-1][j-xx]
print(dp[n][size+1]-1)