#include<bits/stdc++.h>
using namespace std;

const int N=100005;
const long long MOD=1e9+7;
int n,m,a[N];
long long dp[N][105];
char str[N];

long long dfs(int x,int s,int limit)
{
	if(x==n+1)
	{
		dp[x][s]=(s==0);
		return dp[x][s];
	}
	if(!limit&&dp[x][s]>-1) return dp[x][s];
	int rb;
	long long res=0;
	if(limit) rb=a[x]; else rb=9;
	for(int i=0;i<=rb;i++)
	{
		res=(res+dfs(x+1,(s+i)%m,(limit&&(i==rb))))%MOD;
	}
	if(!limit) dp[x][s]=res;
	return res;
}

int main()
{
	scanf("%s%d",str,&m),n=strlen(str);
	for(int i=1;i<=n;i++) a[i]=str[i-1]-'0';
	memset(dp,-1,sizeof(dp));
	printf("%lld\n",(dfs(1,0,1)+MOD-1)%MOD);
}
### Prompt

Your challenge is to write a CPP solution to the following problem:

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>
using namespace std;

const int N=100005;
const long long MOD=1e9+7;
int n,m,a[N];
long long dp[N][105];
char str[N];

long long dfs(int x,int s,int limit)
{
	if(x==n+1)
	{
		dp[x][s]=(s==0);
		return dp[x][s];
	}
	if(!limit&&dp[x][s]>-1) return dp[x][s];
	int rb;
	long long res=0;
	if(limit) rb=a[x]; else rb=9;
	for(int i=0;i<=rb;i++)
	{
		res=(res+dfs(x+1,(s+i)%m,(limit&&(i==rb))))%MOD;
	}
	if(!limit) dp[x][s]=res;
	return res;
}

int main()
{
	scanf("%s%d",str,&m),n=strlen(str);
	for(int i=1;i<=n;i++) a[i]=str[i-1]-'0';
	memset(dp,-1,sizeof(dp));
	printf("%lld\n",(dfs(1,0,1)+MOD-1)%MOD);
}
```