N, K = map(int,input().split()) A = list(map(int,input().split())) dp = [[[0]*(max(sum(A),N*K)+1) for k in range(N+1)] for l in range(N+1)] # dp[i][j][k] := i番目まででj人選んで合計点がkになる組み合わせの数 dp[0][0][0] = 1 for i in range(N): for j in range(N): for k in range(sum(A)+1): dp[i+1][j][k] += dp[i][j][k] if k-A[i] >= 0: dp[i+1][j+1][k] += dp[i][j][k-A[i]] ans = 0 for k in range(1,N+1): ans += sum(dp[N][k][K*k:]) print(ans)