n, a = [ int(v) for v in input().split() ]
num_list = [ int(v) for v in input().split() ]
max_num = max(num_list)
field = [ [ 0 for i in range(max_num*n+1) ] for i in range(n+1) ]
field[0][0] = 1

b = num_list[0]
for i in num_list:
    for j in range(n,0,-1):
        for k in range(max_num*n+1):
            if k >= i:
                field[j][k] += field[j-1][k-i]



ans = 0
for i in range(1,n+1):
    ans += field[i][a*i]
print(ans)
