# include "iostream"
# include "cstdio"
# include "cstring"

using namespace std;

const int maxm=1e5+10;
const int maxn=1e2+10;
const int Mod=1e9+7;

char S[maxm];
int K,Len;
long long DP[maxm][maxn];

int main(){
	register int i,j,l,Num=0;
	register long long Ans=0;
	scanf("%s%d",S,&K);
	Len=strlen(S);
	DP[0][0]=1;
	for(i=1;i<Len;i++){
		for(l=0;l<=9;l++){
			for(j=0;j<=K;j++){
				DP[i][(j+l)%K]=(DP[i][(j+l)%K]+DP[i-1][j])%Mod;
			}
		}
	}
	for(i=0;i<Len;Num=(Num+S[i]-'0')%K,i++){
		for(j=0;j<S[i]-'0';j++){
			Ans=(Ans+DP[Len-i-1][(K-(Num+j)%K)%K])%Mod;
		}
	}
	if(Num) Ans--;
	Ans=(Ans+Mod)%Mod;
	printf("%lld",Ans);
	return 0;
}
### Prompt

Construct a CPP code solution to the problem outlined:

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 "iostream"
# include "cstdio"
# include "cstring"

using namespace std;

const int maxm=1e5+10;
const int maxn=1e2+10;
const int Mod=1e9+7;

char S[maxm];
int K,Len;
long long DP[maxm][maxn];

int main(){
	register int i,j,l,Num=0;
	register long long Ans=0;
	scanf("%s%d",S,&K);
	Len=strlen(S);
	DP[0][0]=1;
	for(i=1;i<Len;i++){
		for(l=0;l<=9;l++){
			for(j=0;j<=K;j++){
				DP[i][(j+l)%K]=(DP[i][(j+l)%K]+DP[i-1][j])%Mod;
			}
		}
	}
	for(i=0;i<Len;Num=(Num+S[i]-'0')%K,i++){
		for(j=0;j<S[i]-'0';j++){
			Ans=(Ans+DP[Len-i-1][(K-(Num+j)%K)%K])%Mod;
		}
	}
	if(Num) Ans--;
	Ans=(Ans+Mod)%Mod;
	printf("%lld",Ans);
	return 0;
}
```