import sys
import itertools
from collections import defaultdict

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    N, A = in_nn()
    X = in_nl()

    for i in range(N):
        X[i] -= A

    N1 = N // 2
    N2 = N - N1

    comb1 = itertools.product(range(2), repeat=N1)
    comb2 = itertools.product(range(2), repeat=N2)

    d1 = defaultdict(int)
    d2 = defaultdict(int)

    for comb in comb1:
        sum = 0
        for i, c in enumerate(comb):
            if c == 1:
                sum += X[i]
        d1[sum] += 1

    for comb in comb2:
        sum = 0
        for i, c in enumerate(comb):
            if c == 1:
                sum += X[N1 + i]
        d2[sum] += 1

    ans = 0
    for k, v in d1.items():
        ans += v * d2[-k]

    ans -= 1
    print(ans)


if __name__ == '__main__':
    main()
