#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include // AtCoder // #include // using namespace atcoder; #ifdef LOCAL #define eprintf(...) fprintf(stderr, __VA_ARGS__) #else #define eprintf(...) #endif #define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i) #define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__) #define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i) #define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__) #define all(x) (x).begin(), (x).end() template bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } #define fls(x) (64 - __builtin_clzll(x)) #define pcnt(x) __builtin_popcountll(x) using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; typedef long double ld; int main (void) { cin.tie(0); ios::sync_with_stdio(false); ll n, k; cin >> n >> k; ll MOD = (ll)1e9 + 7; vector a(n); rep (i, n) cin >> a[i]; vector> dp(n + 1, vector(10001)); dp[0][0] = 1; rep (i, n) { reprev (x, i + 1) { reprev (s, 10001) { dp[x + 1][s + a[i]] = (dp[x + 1][s + a[i]] + dp[x][s]) % MOD; }} } ll ans = 0; rep (i, 1, n + 1) rep (j, i * k, 10001) ans += dp[i][j]; cout << ans % MOD << "\n"; /***************************************************/ /* Use "submit code (with ACL v1)" when using ACL! */ /***************************************************/ return 0; }