n,a=list(map(int,input().split()))

y=[a-int(x) for x in input().split()]

dp={0:1}

for i in y:

	for k,v in list(dp.items()):

		dp[i+k]=dp.get(i+k,0)+v

print((dp[0]-1))
def main():

	n,a=list(map(int,input().split()))

	y=[a-int(x) for x in input().split()]

	dp={0:1}

	for i in y:

		for k,v in list(dp.items()):

			dp[i+k]=dp.get(i+k,0)+v

	print((dp[0]-1))

if __name__=="__main__":

	main()
n, a = list(map(int, input().split()))
y = [a - int(x) for x in input().split()]
dp = {0: 1}
for i in y:
    for k, v in list(dp.items()):
        dp[i + k] = dp.get(i + k, 0) + v
print((dp[0] - 1))

def main():
    n, a = list(map(int, input().split()))
    y = [a - int(x) for x in input().split()]
    dp = {0: 1}
    for i in y:
        for k, v in list(dp.items()):
            dp[i + k] = dp.get(i + k, 0) + v
    print((dp[0] - 1))


if __name__ == "__main__":
    main()

-n, a = list(map(int, input().split())) -y = [a - int(x) for x in input().split()] -dp = {0: 1} -for i in y: -    for k, v in list(dp.items()): -        dp[i + k] = dp.get(i + k, 0) + v -print((dp[0] - 1)) +def main(): +    n, a = list(map(int, input().split())) +    y = [a - int(x) for x in input().split()] +    dp = {0: 1} +    for i in y: +        for k, v in list(dp.items()): +            dp[i + k] = dp.get(i + k, 0) + v +    print((dp[0] - 1)) + + +if __name__ == "__main__": +    main()