#include <bits/stdc++.h>
using namespace std;
long long P=1000000007;
long long dp[10009][105][2];
long long dig(int i,int r,int f,string &k,int d){
	if(i==k.size()){
		if(r%d==0)
			dp[i][r][f]=1;
		else
			dp[i][r][f]=0;
	}
	if(dp[i][r][f]==-1){
		long long sum=0;
		if(f==1){
			int j=0;
			for(j=0;j<(k[i]-'0');j++)
				sum=(sum+dig(i+1,(r-j+d)%d,0,k,d))%P;
			sum=(sum+dig(i+1,(r-j+d)%d,1,k,d))%P;
		}
		else{
			int j;
			for(j=0;j<10;j++)
				sum=(sum+dig(i+1,(r-j+d)%d,0,k,d))%P;
		}
		dp[i][r][f]=sum;
	}
	return dp[i][r][f];
}
int main(){
	string k;
	int d;
	cin >> k;
	cin >> d;
	memset(dp,-1,sizeof(long long)*10009*105*2);
	cout << (dig(0,0,1,k,d)-1+P)%P << endl;
}
### Prompt

Please formulate 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;
long long P=1000000007;
long long dp[10009][105][2];
long long dig(int i,int r,int f,string &k,int d){
	if(i==k.size()){
		if(r%d==0)
			dp[i][r][f]=1;
		else
			dp[i][r][f]=0;
	}
	if(dp[i][r][f]==-1){
		long long sum=0;
		if(f==1){
			int j=0;
			for(j=0;j<(k[i]-'0');j++)
				sum=(sum+dig(i+1,(r-j+d)%d,0,k,d))%P;
			sum=(sum+dig(i+1,(r-j+d)%d,1,k,d))%P;
		}
		else{
			int j;
			for(j=0;j<10;j++)
				sum=(sum+dig(i+1,(r-j+d)%d,0,k,d))%P;
		}
		dp[i][r][f]=sum;
	}
	return dp[i][r][f];
}
int main(){
	string k;
	int d;
	cin >> k;
	cin >> d;
	memset(dp,-1,sizeof(long long)*10009*105*2);
	cout << (dig(0,0,1,k,d)-1+P)%P << endl;
}
```