#include<bits/stdc++.h>
using namespace std;
#define ll long long 
const ll p=1000000007;
const int maxn=2e4+5;
int d,a[maxn];
ll dp[maxn][200];

ll dfs(int pos,int sum,int limit){
	if(pos==-1) return sum%d==0;
    if(!limit && dp[pos][sum]!=-1) return dp[pos][sum]%p;
    int up=limit ? a[pos] : 9;
    ll ans=0;
    for(int i=0;i<=up;i++){
        ans+=dfs(pos-1,(sum+i)%d,limit && i==a[pos]);
        ans%=p;
    }
    if(!limit) dp[pos][sum]=ans;
    return ans;
}

ll solve(string x){
	memset(dp,-1,sizeof(dp));
	int pos=0;
	for (int i=x.size()-1;i>=0;i--){
		a[pos++]=x[i]-'0';
	}
	return dfs(pos-1,0,1);
}

int main(){
	string k;
	cin>>k>>d;
	cout<<(solve(k)+p-1)%p;
}
### Prompt

Generate 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 ll long long 
const ll p=1000000007;
const int maxn=2e4+5;
int d,a[maxn];
ll dp[maxn][200];

ll dfs(int pos,int sum,int limit){
	if(pos==-1) return sum%d==0;
    if(!limit && dp[pos][sum]!=-1) return dp[pos][sum]%p;
    int up=limit ? a[pos] : 9;
    ll ans=0;
    for(int i=0;i<=up;i++){
        ans+=dfs(pos-1,(sum+i)%d,limit && i==a[pos]);
        ans%=p;
    }
    if(!limit) dp[pos][sum]=ans;
    return ans;
}

ll solve(string x){
	memset(dp,-1,sizeof(dp));
	int pos=0;
	for (int i=x.size()-1;i>=0;i--){
		a[pos++]=x[i]-'0';
	}
	return dfs(pos-1,0,1);
}

int main(){
	string k;
	cin>>k>>d;
	cout<<(solve(k)+p-1)%p;
}
```