#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "functional"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N >> K;
	vector<vector<long long int>>dp(N + 1, vector<long long int>(N*N + 1));
	dp[N][0] = 1;
	vector<vector<long long int>>ans(N + 1, vector<long long int>(N*N + 1));
	for (int i = N; i > 0; i--) {
		for (int j = 0; j <= N * N; j++) {
			for (int k = 0; k <= K; k++) {
				int nxj = j;
				long long int amari = 0;
				if (k > i) {
					amari = k+j;
				}
				else {
					amari = (k + j) % i;
					nxj += (k + j) / i;
				}
				if (nxj > N*N)continue;
				dp[i - 1][nxj] += dp[i][j];
				dp[i - 1][nxj] %= MOD;
				ans[i - 1][nxj] += ans[i][j] + amari * dp[i][j];
				ans[i - 1][nxj] %= MOD;
			}
		}
	}
	M = accumulate(ans.front().begin(), ans.front().end(), 0LL);
	cout << M % MOD << endl;
}
### Prompt

Your task is to create a CPP solution to the following problem:

Consider the following game:

* The game is played using a row of N squares and many stones.
* First, a_i stones are put in Square i\ (1 \leq i \leq N).
* A player can perform the following operation as many time as desired: "Select an integer i such that Square i contains exactly i stones. Remove all the stones from Square i, and add one stone to each of the i-1 squares from Square 1 to Square i-1."
* The final score of the player is the total number of the stones remaining in the squares.



For a sequence a of length N, let f(a) be the minimum score that can be obtained when the game is played on a.

Find the sum of f(a) over all sequences a of length N where each element is between 0 and K (inclusive). Since it can be extremely large, find the answer modulo 1000000007 (= 10^9+7).

Constraints

* 1 \leq N \leq 100
* 1 \leq K \leq N

Input

Input is given from Standard Input in the following format:


N K


Output

Print the sum of f(a) modulo 1000000007 (= 10^9+7).

Examples

Input

2 2


Output

10


Input

20 17


Output

983853488

### Response

```cpp
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "functional"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N >> K;
	vector<vector<long long int>>dp(N + 1, vector<long long int>(N*N + 1));
	dp[N][0] = 1;
	vector<vector<long long int>>ans(N + 1, vector<long long int>(N*N + 1));
	for (int i = N; i > 0; i--) {
		for (int j = 0; j <= N * N; j++) {
			for (int k = 0; k <= K; k++) {
				int nxj = j;
				long long int amari = 0;
				if (k > i) {
					amari = k+j;
				}
				else {
					amari = (k + j) % i;
					nxj += (k + j) / i;
				}
				if (nxj > N*N)continue;
				dp[i - 1][nxj] += dp[i][j];
				dp[i - 1][nxj] %= MOD;
				ans[i - 1][nxj] += ans[i][j] + amari * dp[i][j];
				ans[i - 1][nxj] %= MOD;
			}
		}
	}
	M = accumulate(ans.front().begin(), ans.front().end(), 0LL);
	cout << M % MOD << endl;
}
```