# dp[i][j][k] i枚処理した　j枚選んだ　和がk の場合の数
n,a = map(int,input().split())
dp = [[[0 for _ in range(3000)] for _ in range(n+1)] for _ in range(n+1)]
l = list(map(int,input().split()))
dp[0][0][0] = 1
s = 0
for i in range(n):
    for j in range(i+1):
        for k in range(s+1):
            if dp[i][j][k]!=0:
                dp[i+1][j][k]+=dp[i][j][k]
                dp[i+1][j+1][k+l[i]]+=dp[i][j][k]
    s+=l[i]
res = 0
for i in range(1,n+1):
    res+=dp[n][i][a*i]
print(res)