import collections

N, A = list(map(int, input().split()))

xs = list(map(int, input().split()))



dp = collections.defaultdict(lambda: 0)

dp[(0, 0)] = 1

for n, x in enumerate(xs, start=1):

    for (k, accum), count in list(dp.items()):

        dp[(k + 1, accum + x)] += count

found = 0

for (k, accum), count in list(dp.items()):

    if k > 0 and k * A == accum:

        found += count

print(found)
import collections

N, A = list(map(int, input().split()))

ys = [int(x) - A for x in input().split()]



dp = collections.defaultdict(lambda: 0)

dp[0] = 1

for y in ys:

    for accum, count in list(dp.items()):

        dp[accum + y] += count

found = -1 # for dp[0]

for accum, count in list(dp.items()):

    if accum == 0:

        found += count

print(found)
import collections

N, A = list(map(int, input().split()))
xs = list(map(int, input().split()))
dp = collections.defaultdict(lambda: 0)
dp[(0, 0)] = 1
for n, x in enumerate(xs, start=1):
    for (k, accum), count in list(dp.items()):
        dp[(k + 1, accum + x)] += count
found = 0
for (k, accum), count in list(dp.items()):
    if k > 0 and k * A == accum:
        found += count
print(found)

import collections

N, A = list(map(int, input().split()))
ys = [int(x) - A for x in input().split()]
dp = collections.defaultdict(lambda: 0)
dp[0] = 1
for y in ys:
    for accum, count in list(dp.items()):
        dp[accum + y] += count
found = -1  # for dp[0]
for accum, count in list(dp.items()):
    if accum == 0:
        found += count
print(found)

-xs = list(map(int, input().split())) +ys = [int(x) - A for x in input().split()] -dp[(0, 0)] = 1 -for n, x in enumerate(xs, start=1): -    for (k, accum), count in list(dp.items()): -        dp[(k + 1, accum + x)] += count -found = 0 -for (k, accum), count in list(dp.items()): -    if k > 0 and k * A == accum: +dp[0] = 1 +for y in ys: +    for accum, count in list(dp.items()): +        dp[accum + y] += count +found = -1  # for dp[0] +for accum, count in list(dp.items()): +    if accum == 0: