# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,a,*x = map(int,read().split())

x = [i-a for i in x]

d = {0:1}
for i in x:
    nd = d.copy()
    for k,v in d.items():
        if k+i in nd:
            nd[k+i] += v
        else:
            nd[k+i] = v

    d = nd

    #print(d)
print(d[0]-1)