#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
long long a[10005][102][2];
long long n,d,mod=1000000007;
string s;
long long ff(int i,int cnt,int tight){
if(i==n && cnt==0) return(1);
if(i==n) return(0);
if(a[i][cnt][tight] !=-1) return(a[i][cnt][tight]);
int end;
if(tight==0) end=9;
if(tight==1) end=s[i]-'0';
long long ans=0;
for(int j=0;j<=end;j++){
if(!tight){ans=ans+ff(i+1,(cnt+j)%d,tight);}
else{
if(j !=end) {ans=ans+ff(i+1,(cnt+j)%d,0);}
else {ans=ans+ff(i+1,(cnt+j)%d,1);}
}
}ans=ans%mod;
a[i][cnt][tight]=ans;
return(ans);
}
int main(){
long long ans;
int t,i;
memset(a,-1,sizeof(a));
cin>>s;n=s.size();cin>>d;
ans=(ff(0,0,1)-1+mod)%mod;
cout<<ans<<endl;

}
### 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>
#include <cstdio>
using namespace std;
long long a[10005][102][2];
long long n,d,mod=1000000007;
string s;
long long ff(int i,int cnt,int tight){
if(i==n && cnt==0) return(1);
if(i==n) return(0);
if(a[i][cnt][tight] !=-1) return(a[i][cnt][tight]);
int end;
if(tight==0) end=9;
if(tight==1) end=s[i]-'0';
long long ans=0;
for(int j=0;j<=end;j++){
if(!tight){ans=ans+ff(i+1,(cnt+j)%d,tight);}
else{
if(j !=end) {ans=ans+ff(i+1,(cnt+j)%d,0);}
else {ans=ans+ff(i+1,(cnt+j)%d,1);}
}
}ans=ans%mod;
a[i][cnt][tight]=ans;
return(ans);
}
int main(){
long long ans;
int t,i;
memset(a,-1,sizeof(a));
cin>>s;n=s.size();cin>>d;
ans=(ff(0,0,1)-1+mod)%mod;
cout<<ans<<endl;

}
```