import itertools
import pandas as pd

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

X = list(map(int, input().rstrip().split()))

def isA_erase(X):
    """
    erase A in X and count items
    input
    X: input list
    output
    X: erased list
    count: erase item num
    """
    erase_count = 0
    while A in X:
        X.remove(A)
        erase_count += 1
    
    return X, erase_count

X, erase_count = isA_erase(X)
count = 0
# Xの中にあるAを除いて作ることのできるAの数
for i in range(1, N+1 - erase_count):
    cards_list = np.array(list(itertools.combinations(X, i)))
    cards_average = np.sum(cards_list, axis= -1) / i
    count += np.sum(cards_average == A)
count = count * (pow(2, erase_count) - 1) + count + (pow(2, erase_count) - 1)
print(count)