#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll ans=0,n,k,dp[105][10005],i,j,u,num;
const ll mod=1e9+7;
ll pow(ll a,ll b)
{
	ll ans=1;
	while(b)
	{
		if(b&1)ans=ans*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ans;
}
ll M(ll x){return x>=mod?x-mod:x;}
int main()
{
	scanf("%lld%lld",&n,&k);
	ans=n*(1LL+k)*k/2LL*pow(k+1LL,n-1LL)%mod;
	dp[n+1][0]=1;
	for(i=n;i>0;i--)
	{
		for(j=0;j<=(n-i)*k;j++)
		{
			for(u=0;u<=k;u++)
			{
				if(u>i||i-u>j)num=0;
				else num=1+(j-(i-u))/i;
				dp[i][j+num]=M(dp[i][j+num]+dp[i+1][j]);
			}
		}
	}
	//printf("%lld\n",ans);
	//for(i=1;i<=n;i++)for(j=0;j<=n;j++)printf("%lld %lld %lld\n",i,j,dp[i][j]);
	for(i=1;i<=n*k;i++)ans=M(ans-dp[1][i]*i%mod+mod);
	printf("%lld\n",ans);
	return 0;
}
### Prompt

Construct a CPP code solution to the problem outlined:

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<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll ans=0,n,k,dp[105][10005],i,j,u,num;
const ll mod=1e9+7;
ll pow(ll a,ll b)
{
	ll ans=1;
	while(b)
	{
		if(b&1)ans=ans*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ans;
}
ll M(ll x){return x>=mod?x-mod:x;}
int main()
{
	scanf("%lld%lld",&n,&k);
	ans=n*(1LL+k)*k/2LL*pow(k+1LL,n-1LL)%mod;
	dp[n+1][0]=1;
	for(i=n;i>0;i--)
	{
		for(j=0;j<=(n-i)*k;j++)
		{
			for(u=0;u<=k;u++)
			{
				if(u>i||i-u>j)num=0;
				else num=1+(j-(i-u))/i;
				dp[i][j+num]=M(dp[i][j+num]+dp[i+1][j]);
			}
		}
	}
	//printf("%lld\n",ans);
	//for(i=1;i<=n;i++)for(j=0;j<=n;j++)printf("%lld %lld %lld\n",i,j,dp[i][j]);
	for(i=1;i<=n*k;i++)ans=M(ans-dp[1][i]*i%mod+mod);
	printf("%lld\n",ans);
	return 0;
}
```