#include #include #include #include #include #include #include using namespace std; constexpr int P = 1000000007; constexpr int N = 300, K = N * (N - 1) / 2; int dp[K + 1]; int main() { int n, k; cin >> n >> k; dp[0] = 1; for (int i = 2; i <= n; i++) { int k1 = min(k, i * (i - 1) / 2); int64_t t = 0; for (int j = max(0, k1 - i + 1); j <= k1; j++) { t += dp[j]; } t %= P; for (int j = k1; j >= 0; j--) { int s = t; t -= dp[j]; if (t < 0) t += P; if (j - i >= 0) { t += dp[j - i]; if (t >= P) t -= P; } dp[j] = s; } } int64_t r = 0; for (int j = 0; j <= k; j++) { r += dp[j]; } r %= P; cout << r << endl; return 0; }