n,a = map(int, input().split())
x = list(map(int, input().split()))
for i in range(n):
    x[i] -= a
#x.sort()
#print(x)
#dp[i][j]: i枚目まで、値ｊ
dp = [[0]*5001 for _ in range(n+1)]
dp[0][2500]=1
for i in range(0,n):
    for j in range(0,5001):
        if (dp[i][j]!=0):
            dp[i+1][j] += dp[i][j]
            dp[i+1][j+x[i]] += dp[i][j]
print(dp[n][2500]-1)