n,a = map(int,input().split())
x = list(map(int,input().split()))
x = [t-a for t in x]
p = [0]*5010
p[0] = 1
q = [0]*5010
for t in x:
  for i in range(5010):
    q[i] = p[i] + p[(i-t)%5010] 
  for i in range(5010):
    p[i] = q[i]
print(p[0]-1)