#include<cstdio>
#include<cstring>
#define N 100005
#define mod 1000000007
int n;
char c[N];
int dp[N][105][2];
int D;
void add(int &x,int y){x+=y;if(x>=mod)x-=mod;}
int main(){
	scanf("%s%d",c,&D);
	n=strlen(c);
	dp[0][0][1]=1;
	for(int i=0;i<n;++i){
		for(int j=0;j<D;++j){
			for(int f=0;f<2;++f){
				for(int k=0;k<=(f?c[i]-'0':9);++k){
					add(dp[i+1][(j+k)%D][f?k==c[i]-'0':0],dp[i][j][f]);
				}
			}
		}
	}
	printf("%d\n",(dp[n][0][0]+dp[n][0][1]+mod-1)%mod);
	return 0;
}

### Prompt

Please create a solution in cpp 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<cstdio>
#include<cstring>
#define N 100005
#define mod 1000000007
int n;
char c[N];
int dp[N][105][2];
int D;
void add(int &x,int y){x+=y;if(x>=mod)x-=mod;}
int main(){
	scanf("%s%d",c,&D);
	n=strlen(c);
	dp[0][0][1]=1;
	for(int i=0;i<n;++i){
		for(int j=0;j<D;++j){
			for(int f=0;f<2;++f){
				for(int k=0;k<=(f?c[i]-'0':9);++k){
					add(dp[i+1][(j+k)%D][f?k==c[i]-'0':0],dp[i][j][f]);
				}
			}
		}
	}
	printf("%d\n",(dp[n][0][0]+dp[n][0][1]+mod-1)%mod);
	return 0;
}

```