N,A=map(int,input().split())
x=list(map(int,input().split()))
x=list(map(lambda x:x-A,x))
dp=[]
MX=50*50
for i in range(N+1):
    dp.append([0 for j in range(2*MX+2)])
dp[0][MX]=1
for i in range(N):
    for j in range(2*MX+2):
        dp[i+1][j]+=dp[i][j]
        if 0<=j+x[i]<=2*MX+1:
            dp[i+1][j+x[i]]+=dp[i][j]
print(dp[N][MX]-1)