import sys
sys.setrecursionlimit(10**9)
n, a = map(int, input().split())
x = list(map(int, input().split()))

def rec(i, j, tmp):
  if i == n:
    if j and tmp / j == a:
      return 1
    else:
      return 0
  return rec(i+1, j+1, tmp + x[i]) + rec(i+1, j, tmp)
  
print(rec(0, 0, 0))
