N,A = map(int, input().split())
Xs = [0] + list(map(int, input().split()))

memo = [[[0]*(A*N+1) for _ in range(N+1)] for _ in range(N+1)]

memo[0][0][0] = 1

for i in range(1,N+1):
  for j in range(N+1):
    for k in range(A*N+1):
      if k - Xs[i] >= 0:
        memo[i][j][k] = memo[i-1][j-1][k-Xs[i]] + memo[i-1][j][k]
      else:
        memo[i][j][k] = memo[i-1][j][k]
        
rlt = 0
for i in range(1,N+1):
  rlt += memo[N][i][i*A]
  
print(rlt)