#include <bits/stdc++.h>
using namespace std;
const int mx = 1e4+5;
const int md = 1e9+7;

string s; int d;
int dp[mx][2][105];

int fun(int idx, int f, int v){
    if(idx == s.size()) return v==0;

    int &ans = dp[idx][f][v];
    if(ans != -1) return ans; ans=0;

    int val = s[idx] - '0';
    int lim = f>0 ? 9 : val;
    for(int i=0; i<=lim; i++)
        ans += fun(idx+1, i!=val?1:f, (v+i)%d), ans %= md;
    return ans;
}

int main(){

    cin.tie( nullptr );
    ios_base::sync_with_stdio(0);

    cin >> s >> d;
    memset(dp, -1, sizeof dp);
    cout << (fun(0, 0, 0)-1+md)%md << "\n";

    return 0;
}

### Prompt

In Cpp, your task is to solve 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 int mx = 1e4+5;
const int md = 1e9+7;

string s; int d;
int dp[mx][2][105];

int fun(int idx, int f, int v){
    if(idx == s.size()) return v==0;

    int &ans = dp[idx][f][v];
    if(ans != -1) return ans; ans=0;

    int val = s[idx] - '0';
    int lim = f>0 ? 9 : val;
    for(int i=0; i<=lim; i++)
        ans += fun(idx+1, i!=val?1:f, (v+i)%d), ans %= md;
    return ans;
}

int main(){

    cin.tie( nullptr );
    ios_base::sync_with_stdio(0);

    cin >> s >> d;
    memset(dp, -1, sizeof dp);
    cout << (fun(0, 0, 0)-1+md)%md << "\n";

    return 0;
}

```