#include<bits/stdc++.h>
using namespace std;
const int Mod=1e9+7;
char s[10010];
int d,l,f[10010][110];
void upd(int &x,int v)
{
	x=(x+v)%Mod;
}
int main()
{
	scanf("%s",s+1);
	l=strlen(s+1);
	scanf("%d",&d);
	int sum=0;
	for (int i=1;i<=l;i++)
	{
		for (int j=0;j<s[i]-'0';j++)
		{
			upd(f[i][(sum+j)%d],1);
		}
		sum=(sum+s[i]-'0')%d;
		for (int j=0;j<d;j++)
		{
			for (int k=0;k<10;k++)
			{
				upd(f[i][(j+k)%d],f[i-1][j]);
			}
		}
		/*
		for (int j=0;j<d;j++)
		{
			cerr<<f[i][j]<<" ";
		}
		cerr<<endl;
		*/
	}
	int res=f[l][0];
	if (sum)
	{
		upd(res,Mod-1);
	}
	cout<<res<<endl;
	return 0;
}

### Prompt

Create a solution in CPP for 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 Mod=1e9+7;
char s[10010];
int d,l,f[10010][110];
void upd(int &x,int v)
{
	x=(x+v)%Mod;
}
int main()
{
	scanf("%s",s+1);
	l=strlen(s+1);
	scanf("%d",&d);
	int sum=0;
	for (int i=1;i<=l;i++)
	{
		for (int j=0;j<s[i]-'0';j++)
		{
			upd(f[i][(sum+j)%d],1);
		}
		sum=(sum+s[i]-'0')%d;
		for (int j=0;j<d;j++)
		{
			for (int k=0;k<10;k++)
			{
				upd(f[i][(j+k)%d],f[i-1][j]);
			}
		}
		/*
		for (int j=0;j<d;j++)
		{
			cerr<<f[i][j]<<" ";
		}
		cerr<<endl;
		*/
	}
	int res=f[l][0];
	if (sum)
	{
		upd(res,Mod-1);
	}
	cout<<res<<endl;
	return 0;
}

```