#include #define rep(i,n) for(int i=0; i<(int)(n); i++) using namespace std; using LL = long long; const LL mod = 1e9 + 7; const int Max_N = 100; const int Max_K = 100; const int Max_A = 100; LL dp[2][Max_N + 5][Max_N * Max_A + 5]; int main(){ int N, K; cin >> N >> K; assert(1 <= N and N <= Max_N); assert(0 <= K and K <= Max_K); vector A(N); rep(i,N){ int a; cin >> a; assert(0 <= a and a <= Max_A); A[i] = a; } dp[0][0][0] = 1; for(int i = 1; i <= N; i++){ for(int j = 0; j <= i; j++){ for(int S = 0; S <= i * Max_A; S++){ dp[i%2][j][S] = dp[(i+1)%2][j][S]; if(S >= A[i-1] and j > 0){ dp[i%2][j][S] += dp[(i+1)%2][j-1][S-A[i-1]]; } dp[i%2][j][S] %= mod; } } } LL ans = 0; for(int j = 1; j <= N; j++){ for(int S = j * K; S <= j * Max_A; S++){ ans += dp[N%2][j][S]; ans %= mod; } } cout << ans << endl; return 0; }