n,a = map(int, input().split())
list_x = list(map(int, input().split()))
dp = [ [[0] * 2600 for i in range(100)] for j in range(100)]
for j in range(n+1):
	for k in range(n+1):
		for s in range(sum(list_x) + 1):
			if j == 0 and k == 0 and s == 0:
				dp[j][k][s] = 1
			elif j >= 1 and s < list_x[j - 1]:
				dp[j][k][s] = dp[j - 1][k][s]
			elif j >= 1 and k >= 1 and s >= list_x[j - 1]:
				dp[j][k][s] = dp[j - 1][k - 1][s - list_x[j-1]] + dp[j - 1][k][s]
			else:
				dp[j][k][s] = 0
ans = 0
for p in range(1,n+1):
	ans += dp[n][p][p*a]
print(ans)