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

p = { 0: 1 }
for x in X:
  for n, count in list(p.items()):
    if n+x <= 0:
      p[n+x] = p.get(n+x, 0) + count

print(p[0] - 1)