#!/usr/bin/env python3

import array
import math
import statistics


MAX_N = 16


def count_combinations(n, a, xs):
    ans = 0
    for s in range(1, 1 << n):
        m = statistics.mean(xs[i] for i in range(n) if s & (1 << i))
        if math.isclose(a, m):
            ans += 1
    return ans


def main():
    n, a = map(int, input().split())
    assert n <= 16
    xs = array.array("I", map(int, input().split()))
    print(count_combinations(n, a, xs))


if __name__ == '__main__':
    main()
