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


def main():
    N, A = tuple(map(int, input().split()))
    X = tuple(map(int, input().split()))
    Y = [i - A for i in X]
    D = defaultdict(int)
    D[0] = 1
    for i in Y:
        for j, k in D.items():
            D[i + j] += k
    print(D[0] - 1)


if __name__ == "__main__":
    main()