#include <bits/stdc++.h>

using namespace std;

long d[11111][111], e[11111][111];
int p = 1e9 + 7;
int main() {
	string k;
	int D;
	cin >> k >> D;
	d[k.length()][0] = e[k.length()][0] = 1;
	for (int i = k.length(); i--;) {
		for (int j = 0; j < D; j++) {
			int m = k[i] - '0';
			d[i][(j + m) % D] = (d[i][(j + m) % D] + d[i + 1][j]) % p;
			while (m--)
				d[i][(j + m) % D] = (d[i][(j + m) % D] + e[i + 1][j]) % p;
			for (m = 10; m--;)
				e[i][(j + m) % D] = (e[i][(j + m) % D] + e[i + 1][j]) % p;
		}
	}
	cout << (d[0][0] - 1 + p) % p << endl;
	return 0;
}

### Prompt

Please provide a cpp coded solution 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>

using namespace std;

long d[11111][111], e[11111][111];
int p = 1e9 + 7;
int main() {
	string k;
	int D;
	cin >> k >> D;
	d[k.length()][0] = e[k.length()][0] = 1;
	for (int i = k.length(); i--;) {
		for (int j = 0; j < D; j++) {
			int m = k[i] - '0';
			d[i][(j + m) % D] = (d[i][(j + m) % D] + d[i + 1][j]) % p;
			while (m--)
				d[i][(j + m) % D] = (d[i][(j + m) % D] + e[i + 1][j]) % p;
			for (m = 10; m--;)
				e[i][(j + m) % D] = (e[i][(j + m) % D] + e[i + 1][j]) % p;
		}
	}
	cout << (d[0][0] - 1 + p) % p << endl;
	return 0;
}

```