n, a = map(int, input().split())
x = list(map(int, input().split()))


def f(arr, allsum, selnum):
    if len(arr) == selnum:
        return 1 if sum(arr) == allsum else 0
    if selnum == 1:
        return arr.count(allsum)
    return f(arr[0:-1], allsum - arr[-1], selnum - 1) + f(arr[0:-1], allsum, selnum)

if __name__ == "__main__":
    result = 0
    for i in range(1, n + 1):
        result += f(x, a * i, i)
    print(result)
