from sys import stdin, stdout
from itertools import permutations as perms

def main():
	[n, a]=list(map(int, (stdin.readline()).rstrip().split(' ')))
	input=list(map(int, (stdin.readline().rstrip()).split(' ')))
	dp = [[[0 for _ in range(0, 2553)] for _ in range(0, 52)] for _ in  range(0, 52)]

	for i in range(0, n+1):
		dp[i][0][0]=1
	#take each
	for i in range(1, n+1):
		el=input[i-1]
		#how many we use from last i elems
		for j in range(1, i+1):
			# each sum
			for s in range(0, 2553-52):
				dp[i][j][s]+=dp[i-1][j][s]
				dp[i][j][s+el]+=dp[i-1][j-1][s]
	ans=0
	for i in range(1, len(dp[n])):
		ans+=dp[n][i][i*a]
	print(ans)

if __name__=='__main__':
	main()