#include <bits/stdc++.h>
 
using namespace std;
long long x,p[10001][100][2];
vector <long long> d;
string a;
long long cal(long long i,long long s,bool t)
{
    if (i==d.size())
        return !s;
    if (p[i][s][t]>-1)
        return p[i][s][t];
    long long tp=0,lim=(t)?d[i]:9;
    for (long long dg=0; dg<=lim; dg++)
    {
        bool nt=(dg<lim)?0:t;
        tp=(tp+cal(i+1,(s+dg)%x,nt))%1000000007;
    }
    return p[i][s][t]=tp;
}
long long ans(string num)
{
    memset(p,-1,sizeof(p));
    d.clear();
    for (int i=0;i<num.size();i++)
        d.push_back(num[i]-'0');
    return cal(0,0,1);
}
 
int main()
{
    cin>>a>>x;
    cout<<(ans(a)+1000000006)%1000000007;
}
### Prompt

Your challenge is to write 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;
long long x,p[10001][100][2];
vector <long long> d;
string a;
long long cal(long long i,long long s,bool t)
{
    if (i==d.size())
        return !s;
    if (p[i][s][t]>-1)
        return p[i][s][t];
    long long tp=0,lim=(t)?d[i]:9;
    for (long long dg=0; dg<=lim; dg++)
    {
        bool nt=(dg<lim)?0:t;
        tp=(tp+cal(i+1,(s+dg)%x,nt))%1000000007;
    }
    return p[i][s][t]=tp;
}
long long ans(string num)
{
    memset(p,-1,sizeof(p));
    d.clear();
    for (int i=0;i<num.size();i++)
        d.push_back(num[i]-'0');
    return cal(0,0,1);
}
 
int main()
{
    cin>>a>>x;
    cout<<(ans(a)+1000000006)%1000000007;
}
```