N,A = map(int,input().split())
X = [0]+list(map(int,input().split()))
dp = []
for i in range(N+1):
  K = []
  for j in range(N+1):
    J = [0]*(N*max(X)+1)
    K.append(J)
  dp.append(K)
for j in range(N+1):
  for k in range(N+1):
    for s in range(N*max(X)+1):
      if j >= 1:
        if s < X[j]:
          dp[j][k][s] = dp[j-1][k][s]
        elif s >= X[j] and k >= 1:
          dp[j][k][s] = dp[j-1][k][s]+dp[j-1][k-1][s-X[j]]
        else:
          dp[j][k][s] = 0
      else:
        if k == 0 and s == 0:
          dp[j][k][s] = 1
        else:
          dp[j][k][s] = 0
ans = 0
for i in range(N):
  ans += dp[N][i][i*A]
print(ans)