N, A = map(int,input().split())
x = list(map(int,input().split()))
MOD = 5500
DP = [[0]*(MOD) for i in range(N+1)]
DP[0][0] = 1
for i in range(N):
    for j in range(MOD):
        DP[i+1][j] = DP[i][j] + DP[i][(j-A+x[i])%MOD]
print(DP[-1][0] - 1)
