import sys
input = sys.stdin.buffer.readline
import numpy as np

def main():
	N,A = map(int,input().split())
	x = list(map(int,input().split()))
	for i in range(N):
		x[i] -= A

	base = 50*50
	dp = np.zeros(base*2+1,dtype=int)
	dp[base] = 1
	for num in x:
		if num == 0:
			use = dp.copy()
			dp += use
		elif num > 0:
			use = dp[:-num].copy()
			dp[num:] += use
		else:
			use = dp[-num:].copy()
			dp[:num] += use

	print(dp[base]-1)

if __name__ == "__main__":
	main()