#include<bits/stdc++.h>
#define int long long
using namespace std;
const int Maxn=1e4+10,Maxd=1e2+10,MOD=1e9+7;
string K;
int D;
int Sum=0;
int Dp[Maxn][Maxd];
signed main()
{
	cin>>K>>D;
	int N=K.length();
	for(int i=1;i<=N;i++)
	{
		int Num=(int)K[i-1]-'0';
		for(int j=0;j<Num;j++)
		{
			++Dp[i][(Sum+j)%D];
		}
		Sum+=Num;
	}
	++Dp[N][Sum%D];
	for(int i=1;i<=N;i++)
	{
		for(int j=0;j<D;j++)
		{
			for(int denum=0;denum<10;denum++)
			{
				(Dp[i][j]+=Dp[i-1][((j-denum)%D+D)%D])%=MOD;
			}
		}
	}
	cout<<(Dp[N][0]-1+MOD)%MOD<<endl;
	return 0;
}
### Prompt

Develop a solution in CPP to the problem described below:

Find the number of integers between 1 and K (inclusive) satisfying the following condition, modulo 10^9 + 7:

* The sum of the digits in base ten is a multiple of D.

Constraints

* All values in input are integers.
* 1 \leq K < 10^{10000}
* 1 \leq D \leq 100

Input

Input is given from Standard Input in the following format:


K
D


Output

Print the number of integers satisfying the condition, modulo 10^9 + 7.

Examples

Input

30
4


Output

6


Input

1000000009
1


Output

2


Input

98765432109876543210
58


Output

635270834

### Response

```cpp
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int Maxn=1e4+10,Maxd=1e2+10,MOD=1e9+7;
string K;
int D;
int Sum=0;
int Dp[Maxn][Maxd];
signed main()
{
	cin>>K>>D;
	int N=K.length();
	for(int i=1;i<=N;i++)
	{
		int Num=(int)K[i-1]-'0';
		for(int j=0;j<Num;j++)
		{
			++Dp[i][(Sum+j)%D];
		}
		Sum+=Num;
	}
	++Dp[N][Sum%D];
	for(int i=1;i<=N;i++)
	{
		for(int j=0;j<D;j++)
		{
			for(int denum=0;denum<10;denum++)
			{
				(Dp[i][j]+=Dp[i-1][((j-denum)%D+D)%D])%=MOD;
			}
		}
	}
	cout<<(Dp[N][0]-1+MOD)%MOD<<endl;
	return 0;
}
```