N,A=map(int,input().split())
X=list(map(int,input().split()))
DP=[[0]*2501 for i in range(N+1)]
DP[0][0]=1
for k in range(N):
  for i in range(N-1,-1,-1):
    for j in range(2450,-1,-1):
      DP[i+1][j+X[k]]+=DP[i][j]
P=0
for i in range(N+1):
  P+=DP[i][i*A]
print(P-1)