N, A = map(int, input().split())
X = [int(_) - A for _ in input().split()]

dic = {0: 1}
#print(dic.items())

for x in X:
    for i, j in list(dic.items()):
        #print(i, j)
        #print(dic)
        dic[x + i] = dic.get(x+i, 0) + j
print(dic[0] - 1)