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

const int64_t MOD = 1e9+7;
void add(int64_t& a, int64_t b){
    a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
    a = a*b % MOD;
}

string K;
int D, N;

int64_t dp[10001][100][2];

int64_t rec(int d, int r, bool less){
    if(d >= N) return (r==0);
    if(dp[d][r][less] >= 0) return dp[d][r][less];
    int64_t result = 0;
    for(int k=0; k<=(less ? 9 : K[d] - '0'); k++){
        add(result, rec(d+1, (r+k)%D, less | (k < K[d]-'0')));
    }
    dp[d][r][less] = result;
    return result;
}

int main(){
    cin >> K >> D;
    N = K.size();
    memset(dp, -1, sizeof(dp));
    cout << (rec(0, 0, 0) + MOD - 1) % MOD << endl;
    return 0;
}
### 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;

const int64_t MOD = 1e9+7;
void add(int64_t& a, int64_t b){
    a = (a+b) % MOD;
}
void mul(int64_t& a, int64_t b){
    a = a*b % MOD;
}

string K;
int D, N;

int64_t dp[10001][100][2];

int64_t rec(int d, int r, bool less){
    if(d >= N) return (r==0);
    if(dp[d][r][less] >= 0) return dp[d][r][less];
    int64_t result = 0;
    for(int k=0; k<=(less ? 9 : K[d] - '0'); k++){
        add(result, rec(d+1, (r+k)%D, less | (k < K[d]-'0')));
    }
    dp[d][r][less] = result;
    return result;
}

int main(){
    cin >> K >> D;
    N = K.size();
    memset(dp, -1, sizeof(dp));
    cout << (rec(0, 0, 0) + MOD - 1) % MOD << endl;
    return 0;
}
```