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

def search(xs, i=0, m=0):
    if len(xs) == 0:
        if i==A*m and m>0:
            return 1
        else:
            return 0
    else:
        return search(xs[1:], i+xs[0], m+1)  + search(xs[1:], i, m)


print(search(xs))