n,a = map(int,input().split())
x = list(map(int,input().split()))
x.insert(0,0)
xmax = max(x)
table = [[[0 for s in range(n*xmax+1)]for k in range(n+1)]for j in range(n+1)]
table[0][0][0] = 1
for s in range(n*xmax+1):
	for k in range(n+1):
		for j in range(1,n+1):
			if s < x[j]:
				table[j][k][s] = table[j-1][k][s]
			elif k>=1 and s>=x[j]:
				table[j][k][s] = table[j-1][k][s] + table[j-1][k-1][s-x[j]]
			else:
				table[j][k][s] = 0
total = 0
for i in range(n):
	total += table[n][i][i*a]
print(total-1)