# ARC060C - 高橋君とカード / Tak and Cards (ABC044C)
from itertools import combinations


def ans(i, A, lst):
    comb = tuple(combinations(lst, i))
    return sum(1 for i in comb if sum(i) == A)


def main():
    n, a = list(map(int, input().rstrip().split()))
    lst = tuple(map(int, input().rstrip().split()))
    cnt = 0
    for i in range(1, n + 1):
        cnt += ans(i, i * a, lst)
    print(cnt)


if __name__ == "__main__":
    main()