#include<bits/stdc++.h>
using namespace std;
int main(){
  string k;
  int d;
  cin>>k>>d;
  reverse(k.begin(),k.end());
  int p=1000000007;
  vector<vector<int64_t>> dp(k.size()+1,vector<int64_t>(d,0));
  vector<vector<int64_t>> dp9(k.size()+1,vector<int64_t>(d,0));
  dp[0][0]=1;
  dp9[0][0]=1;
  for(int i=1;i<=k.size();i++){
    for(int j=0;j<d;j++){
      for(int x=0;x<10;x++){
        if(x<k.at(i-1)-'0')
          dp[i][j]=(dp[i][j]+dp9[i-1][(j-x+d*10)%d])%p;
        else if(x==k.at(i-1)-'0')
          dp[i][j]=(dp[i][j]+dp[i-1][(j-x+d*10)%d])%p;
        dp9[i][j]=(dp9[i][j]+dp9[i-1][(j-x+d*10)%d])%p;
      }
    }
  }
  cout<<(dp[k.size()][0]-1+p)%p<<endl;
}
### 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;
int main(){
  string k;
  int d;
  cin>>k>>d;
  reverse(k.begin(),k.end());
  int p=1000000007;
  vector<vector<int64_t>> dp(k.size()+1,vector<int64_t>(d,0));
  vector<vector<int64_t>> dp9(k.size()+1,vector<int64_t>(d,0));
  dp[0][0]=1;
  dp9[0][0]=1;
  for(int i=1;i<=k.size();i++){
    for(int j=0;j<d;j++){
      for(int x=0;x<10;x++){
        if(x<k.at(i-1)-'0')
          dp[i][j]=(dp[i][j]+dp9[i-1][(j-x+d*10)%d])%p;
        else if(x==k.at(i-1)-'0')
          dp[i][j]=(dp[i][j]+dp[i-1][(j-x+d*10)%d])%p;
        dp9[i][j]=(dp9[i][j]+dp9[i-1][(j-x+d*10)%d])%p;
      }
    }
  }
  cout<<(dp[k.size()][0]-1+p)%p<<endl;
}
```