n, a = map(int, raw_input().split())
values = sorted(map(lambda s: int(s) - a, raw_input().split()))
counts = {}
for x in values:
    items = counts.items()
    for a, count in items:
        y = x + a
        counts[y] = counts.setdefault(y, 0) + count
    counts[x] = counts.setdefault(x, 0) + 1
print(counts[0] if 0 in counts else 0)
