#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef bitset<16> BS; const ll MOD = 1E+09 + 7; const ll INF = 1E18; const int MAX_N = 100; ll N, K; ll A[MAX_N + 1], dp[MAX_N + 1][2 * MAX_N * MAX_N + 1]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> N >> K; for (int i = 1; i <= N; i++) { cin >> A[i]; A[i] -= K; } dp[0][10000] = 1; for (int i = 1; i <= N; i++) { for (int j = 0; j <= 100 * N + 10000; j++) { dp[i][j] = dp[i - 1][j]; if (j >= A[i] && j - A[i] <= 100 * N + 10000) { dp[i][j] += dp[i - 1][j - A[i]]; dp[i][j] %= MOD; } /* if (dp[i][j] != 0) { cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n"; } */ } } ll ans = 0; for (int j = 10000; j <= 100 * N + 10000; j++) { ans += dp[N][j]; ans %= MOD; } /* for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n"; } } */ cout << (ans - 1 + MOD) % MOD << "\n"; return 0; }