N, A = tuple(map(int, input().split()))
X = list(map(lambda x: int(x) - A, input().split()))
D = {0:0}

for item in X:
  for k,v in list(D.items()):
    D[k+item]=D.get(k+item,0)+v
  D[item]=D.get(item,0)+1

print(D[0])