n,h=map(int,input().split())
A=list(map(int,input().split()))

A= [i-h for i in A]
dp=[[0]*5100 for i in range(n+1)]
dp[0][2500]=1

for i in range(n):
    for j in range(5100):
        if not dp[i][j]: continue
        dp[i+1][j] += dp[i][j]
        #if A[i]==0:continue
        dp[i+1][j+A[i]] +=dp[i][j]

print(dp[n][2500]-1)