#include <bits/stdc++.h>
#define MD 1000000007
using namespace std;
char k[10010];
typedef long long ll;
int d;
ll dp[10010][110][2];
void ds(int dg) {
	for(int j=0;j<d;j++) {
		for(int i=0;i<10;i++) {
			dp[dg+1][(j+i)%d][0] += dp[dg][j][0];
			dp[dg+1][(j+i)%d][0] %= MD;
		}
		int dv = k[dg]-'0';
		for(int i=0;i<=dv;i++) {
			dp[dg+1][(j+i)%d][i==dv] += dp[dg][j][1];
			dp[dg+1][(j+i)%d][i==dv] %= MD;
		}
	}
}
int main() {
	scanf("%s ",k);
	scanf("%d ",&d);
	int l = strlen(k);
	memset(dp,0,sizeof(dp));
	dp[0][0][1] = 1;
	for(int i=0;i<l;i++) {
		ds(i);
	}
	int val = -1;
	for(int i=0;i<2;i++) {
		val += dp[l][0][i];
	}
		//printf("%d\n",dp[l][0][1]);
	val += MD;
	printf("%d\n",val%MD);
}

### Prompt

Develop a solution in cpp to the problem described below:

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>
#define MD 1000000007
using namespace std;
char k[10010];
typedef long long ll;
int d;
ll dp[10010][110][2];
void ds(int dg) {
	for(int j=0;j<d;j++) {
		for(int i=0;i<10;i++) {
			dp[dg+1][(j+i)%d][0] += dp[dg][j][0];
			dp[dg+1][(j+i)%d][0] %= MD;
		}
		int dv = k[dg]-'0';
		for(int i=0;i<=dv;i++) {
			dp[dg+1][(j+i)%d][i==dv] += dp[dg][j][1];
			dp[dg+1][(j+i)%d][i==dv] %= MD;
		}
	}
}
int main() {
	scanf("%s ",k);
	scanf("%d ",&d);
	int l = strlen(k);
	memset(dp,0,sizeof(dp));
	dp[0][0][1] = 1;
	for(int i=0;i<l;i++) {
		ds(i);
	}
	int val = -1;
	for(int i=0;i<2;i++) {
		val += dp[l][0][i];
	}
		//printf("%d\n",dp[l][0][1]);
	val += MD;
	printf("%d\n",val%MD);
}

```