N, A = map(int, raw_input().split())
x = sorted(map(int, raw_input().split()))

def solve(n):
    mem = {}
    def rec(i, a, d):
        if (i, a, d) in mem:
            return mem[(i, a, d)]
        if i >= N:
            return 0
        if a < x[i]:
            return 0
        if d > n:
            return 0
        if x[i] == a and d == n-1:
            mem[(i, a, d)] = rec(i+1, a, d) + 1
        else:
            mem[(i, a, d)] = rec(i+1, a, d) + rec(i+1, a-x[i], d+1)
        return mem[(i, a, d)]
    return rec(0, n*A, 0)

s = 0
for i in xrange(1, N+1):
    s += solve(i)
print s
