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

X = [int(x) for x in input().split()]



m = {}

def f(rv, k, rest):

    if k == 0:

        if rv == 0:

            return 1

        else:

            return 0

    if rv < 0 or len(rest) < k:

        return 0

    

    def r(rv, k, rest):

        fp = (rv, k, len(rest))

        if fp in m: return m[fp]

        ret = f(rv, k, rest)

        m[fp] = ret

        return ret

    ans  = r(rv          , k    , rest[1:])

    ans += r(rv - rest[0], k - 1, rest[1:])

    return ans



print((sum([f(k * A, k, sorted(X)) for k in range(1, N + 1)])))
N, A = list(map(int, input().split()))

X = [int(x) - A for x in input().split()]



import functools

@functools.lru_cache(maxsize=None)

def f(acc, left):

    if not left: return 0

    ret = 0

    y = acc + left[0]

    ret += 1 if y == 0 else 0

    ret += f(y, left[1:])

    ret += f(acc, left[1:])

    return ret

print((f(0, tuple(X))))
N, A = list(map(int, input().split()))
X = [int(x) for x in input().split()]
m = {}


def f(rv, k, rest):
    if k == 0:
        if rv == 0:
            return 1
        else:
            return 0
    if rv < 0 or len(rest) < k:
        return 0

    def r(rv, k, rest):
        fp = (rv, k, len(rest))
        if fp in m:
            return m[fp]
        ret = f(rv, k, rest)
        m[fp] = ret
        return ret

    ans = r(rv, k, rest[1:])
    ans += r(rv - rest[0], k - 1, rest[1:])
    return ans


print((sum([f(k * A, k, sorted(X)) for k in range(1, N + 1)])))

N, A = list(map(int, input().split()))
X = [int(x) - A for x in input().split()]
import functools


@functools.lru_cache(maxsize=None)
def f(acc, left):
    if not left:
        return 0
    ret = 0
    y = acc + left[0]
    ret += 1 if y == 0 else 0
    ret += f(y, left[1:])
    ret += f(acc, left[1:])
    return ret


print((f(0, tuple(X))))

-X = [int(x) for x in input().split()] -m = {} +X = [int(x) - A for x in input().split()] +import functools -def f(rv, k, rest): -    if k == 0: -        if rv == 0: -            return 1 -        else: -            return 0 -    if rv < 0 or len(rest) < k: +@functools.lru_cache(maxsize=None) +def f(acc, left): +    if not left: - -    def r(rv, k, rest): -        fp = (rv, k, len(rest)) -        if fp in m: -            return m[fp] -        ret = f(rv, k, rest) -        m[fp] = ret -        return ret - -    ans = r(rv, k, rest[1:]) -    ans += r(rv - rest[0], k - 1, rest[1:]) -    return ans +    ret = 0 +    y = acc + left[0] +    ret += 1 if y == 0 else 0 +    ret += f(y, left[1:]) +    ret += f(acc, left[1:]) +    return ret -print((sum([f(k * A, k, sorted(X)) for k in range(1, N + 1)]))) +print((f(0, tuple(X))))