#include "bits/stdc++.h"
using namespace std;

int main() {
	string S;
	static long long D, DP[10010][100][10] = {}, MOD = 1000000007;
	cin >> S >> D;
	DP[0][0][0] = 1;
	for (int i = 1; i <= S.size(); i++) {
		for (int j = 0; j < D; j++) {
			for (int k = 0; k < 10; k++) {
				for (int l = 0; l < 10; l++) {
					DP[i][(j + l) % D][l] += DP[i - 1][j][k];
					DP[i][(j + l) % D][l] %= MOD;
				}
			}
		}
	}
	long long NOW = 0, ANS = 0;
	for (int i = 0; i < S.size(); i++) {
		for (int j = 0; j < S[i] - '0'; j++) {
			ANS += DP[S.size() - i][NOW][j];
			ANS %= MOD;
		}
		NOW = (NOW - (S[i] - '0') % D + D) % D;
	}
	if (NOW != 0) ANS = (ANS - 1 + MOD) % MOD;
	cout << ANS << endl;
}
### Prompt

Create a solution in CPP for 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 main() {
	string S;
	static long long D, DP[10010][100][10] = {}, MOD = 1000000007;
	cin >> S >> D;
	DP[0][0][0] = 1;
	for (int i = 1; i <= S.size(); i++) {
		for (int j = 0; j < D; j++) {
			for (int k = 0; k < 10; k++) {
				for (int l = 0; l < 10; l++) {
					DP[i][(j + l) % D][l] += DP[i - 1][j][k];
					DP[i][(j + l) % D][l] %= MOD;
				}
			}
		}
	}
	long long NOW = 0, ANS = 0;
	for (int i = 0; i < S.size(); i++) {
		for (int j = 0; j < S[i] - '0'; j++) {
			ANS += DP[S.size() - i][NOW][j];
			ANS %= MOD;
		}
		NOW = (NOW - (S[i] - '0') % D + D) % D;
	}
	if (NOW != 0) ANS = (ANS - 1 + MOD) % MOD;
	cout << ANS << endl;
}
```