#include <bits/stdc++.h>
#define endl '\n'
#define modulo 1000000007
using namespace std;
///solution created by: Ahmadsm2005
int DP[10001][101][2];
int32_t main()
{
//freopen("output.txt","w", stdout);
//freopen("rect.in","r", stdin);
iostream::sync_with_stdio(0);
cin.tie(0);
string s;
cin>>s;
int m;
cin>>m;
for(int i=0;i<s.size();i++){
for(int l=0;l<m;l++){
for(int x=0;x<=(s[i]-'0');x++){
DP[i+1][(l+x)%m][(x<(s[i]-'0')?1:0)]=(DP[i+1][(l+x)%m][(x<(s[i]-'0')?1:0)]+DP[i][l][0]+((i|l)?0:1))%modulo;
}
for(int x=0;x<=9;x++){
DP[i+1][(l+x)%m][1]=(DP[i+1][(l+x)%m][1]+DP[i][l][1])%modulo;
}
}
}
cout<<((DP[s.size()][0][0]+DP[s.size()][0][1]-1)%modulo+modulo)%modulo;
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>
#define endl '\n'
#define modulo 1000000007
using namespace std;
///solution created by: Ahmadsm2005
int DP[10001][101][2];
int32_t main()
{
//freopen("output.txt","w", stdout);
//freopen("rect.in","r", stdin);
iostream::sync_with_stdio(0);
cin.tie(0);
string s;
cin>>s;
int m;
cin>>m;
for(int i=0;i<s.size();i++){
for(int l=0;l<m;l++){
for(int x=0;x<=(s[i]-'0');x++){
DP[i+1][(l+x)%m][(x<(s[i]-'0')?1:0)]=(DP[i+1][(l+x)%m][(x<(s[i]-'0')?1:0)]+DP[i][l][0]+((i|l)?0:1))%modulo;
}
for(int x=0;x<=9;x++){
DP[i+1][(l+x)%m][1]=(DP[i+1][(l+x)%m][1]+DP[i][l][1])%modulo;
}
}
}
cout<<((DP[s.size()][0][0]+DP[s.size()][0][1]-1)%modulo+modulo)%modulo;
return 0;
}

```