N,A=map(int,input().split())
X=[x-A for x in map(int,input().split())]
dp=[0]*(N*100+1)
dp[0]=1
for x in X:
    if x>0:
        for i in range(N*50,-N*50-1,-1):
            if dp[i]>0:
                dp[i+x]+=dp[i]
    else:
        for i in range(-N*50,N*50+1):
            if dp[i]>0:
                dp[i+x]+=dp[i]
print(dp[0]-1)