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

x = list(map(int, input().split()))
#print(*x)
for i in range(n):
    x[i] -= a
#print(*x)
mx = max(x)*n
mn = min(x)*n
rng = mx + abs(mn)
#print(mx,mn,rng,x[0])
if rng ==0:###3
    rng+=1
dp = [[0 for _ in range(rng+1)]  for i in range(n)]

dp[0][x[0]] += 1
dp[0][0] += 1

for i in range(1,n):
    for sm in range(rng):
        #print(i,sm)
        dp[i][sm] += dp[i-1][sm] + dp[i-1][(sm-x[i]+rng)%rng]###
        
        #print(i,sm,dp[sm][i-1] ,dp[sm-x[i]][i-1])

#for i in range(n):
#    print(*dp[i])

print(dp[n-1][0]-1)#0枚がカウントされてる