N,K=map(int, input().split()) A=list(map(int, input().split())) for i in range(N): A[i]-=K #print(A) dp=[[0 for i in range(20010)]for i in range(N+1)] dp[0][10000]=1 for i in range(N): for j in range(20001): dp[i+1][j]+=dp[i][j-A[i]]+dp[i][j] print(sum(dp[N][10000:])-1)