#include<bits/stdc++.h>

using namespace std;

int n,k,i,j,d,suma,odp;
int tablica[10003][103];
char slowo[10003];

int main() {
	cin >> slowo+1 >> k;
	n=strlen(slowo+1);
	tablica[1][0]=1;
	for(i=2;i<=n;i++){
		for(d=0;d<=9;d++){
			for(j=0;j<=k;j++){
                tablica[i][(d+j)%k]=(tablica[i][(d+j)%k]+(tablica[i-1][j]+1000000007)%1000000007)%1000000007;
			}
        }
    }
	for(i=1;i<=n;i++){
		for(j=0;j<slowo[i]-'0';j++){
            odp=(odp+(tablica[n-i+1][(-(suma+j)%k+k)%k]+1000000007)%1000000007)%1000000007;
		}
		suma=(suma+slowo[i]-'0')%k;
	}
	if(suma){
        odp=(odp+(-1+1000000007)%1000000007)%1000000007;
	}
    cout << odp;
	return 0;
}

### Prompt

Your task is to create 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;

int n,k,i,j,d,suma,odp;
int tablica[10003][103];
char slowo[10003];

int main() {
	cin >> slowo+1 >> k;
	n=strlen(slowo+1);
	tablica[1][0]=1;
	for(i=2;i<=n;i++){
		for(d=0;d<=9;d++){
			for(j=0;j<=k;j++){
                tablica[i][(d+j)%k]=(tablica[i][(d+j)%k]+(tablica[i-1][j]+1000000007)%1000000007)%1000000007;
			}
        }
    }
	for(i=1;i<=n;i++){
		for(j=0;j<slowo[i]-'0';j++){
            odp=(odp+(tablica[n-i+1][(-(suma+j)%k+k)%k]+1000000007)%1000000007)%1000000007;
		}
		suma=(suma+slowo[i]-'0')%k;
	}
	if(suma){
        odp=(odp+(-1+1000000007)%1000000007)%1000000007;
	}
    cout << odp;
	return 0;
}

```