#include<bits/stdc++.h>
using namespace std;
#define N 200005
#define M 1000000007
#define ll long long

string k;
int d, n;
ll dp[N][105][2];

ll cal(int i, int rm, int is)
{
    if(i == n) return rm? 0 : 1;
    if(dp[i][rm][is] != -1) return dp[i][rm][is];
    int mx = is? (k[i] - '0') : 9;
    dp[i][rm][is] = 0;
    for(int j = 0; j <= mx; j++)
    {
        dp[i][rm][is] = (dp[i][rm][is] + cal(i + 1, (rm + j) % d, (is && j == mx) ? true : false)) % M;
    }
    return dp[i][rm][is];
}


int main()
{
    memset(dp, -1, sizeof(dp));
    cin >> k >> d;
    n = k.size();
    cout << (cal(0, 0, 1) - 1 + M) % M << endl;
}


### Prompt

Please formulate a CPP solution to 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;
#define N 200005
#define M 1000000007
#define ll long long

string k;
int d, n;
ll dp[N][105][2];

ll cal(int i, int rm, int is)
{
    if(i == n) return rm? 0 : 1;
    if(dp[i][rm][is] != -1) return dp[i][rm][is];
    int mx = is? (k[i] - '0') : 9;
    dp[i][rm][is] = 0;
    for(int j = 0; j <= mx; j++)
    {
        dp[i][rm][is] = (dp[i][rm][is] + cal(i + 1, (rm + j) % d, (is && j == mx) ? true : false)) % M;
    }
    return dp[i][rm][is];
}


int main()
{
    memset(dp, -1, sizeof(dp));
    cin >> k >> d;
    n = k.size();
    cout << (cal(0, 0, 1) - 1 + M) % M << endl;
}


```