
import itertools
import math

(n, a) = map(int, input().split())
x = tuple(map(int, input().split()))

ans = 0
for card_set in itertools.product([True, False], repeat=n):
    card_num = 0
    card_sum = 0
    for ni in range(n):
        if card_set[ni]:
            card_num += 1
            card_sum += x[ni]
    if card_num > 0:
        if card_sum == card_num * a:
            ans += 1

print(ans)