/*input
100
1
*/
#include<bits/stdc++.h>
using namespace std;
const int N = 1e4+5,N2 = 101,mod=1e9+7;
int dp[2][N2][N];
int D;

int fun(int pos,int f,int sum,string &s) //f==0 prefix equal
{
	if(pos==(int)s.size()) return (sum==0);
	if(dp[f][sum][pos]!=-1) return dp[f][sum][pos];

	int L = 9;
	if(!f) L = s[pos]-'0';

	int ans=0;
	for(int d=0;d<=L;d++)
	{
		int nd = 1;
		if(f==0 && d==L) nd=0;

		int nsum = (sum+d)%D;
		ans+=fun(pos+1,nd,nsum,s);
		ans%=mod; 
	}

	return dp[f][sum][pos]=ans;

}	

int main()
{
	memset(dp,-1,sizeof dp);
	string s;cin>>s;
	cin>>D;
	int ans = fun(0,0,0,s)-1;
	ans%=mod;
	if(ans<0) ans+=mod; 
	cout<<ans<<"\n";

	return 0;
}

### 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
/*input
100
1
*/
#include<bits/stdc++.h>
using namespace std;
const int N = 1e4+5,N2 = 101,mod=1e9+7;
int dp[2][N2][N];
int D;

int fun(int pos,int f,int sum,string &s) //f==0 prefix equal
{
	if(pos==(int)s.size()) return (sum==0);
	if(dp[f][sum][pos]!=-1) return dp[f][sum][pos];

	int L = 9;
	if(!f) L = s[pos]-'0';

	int ans=0;
	for(int d=0;d<=L;d++)
	{
		int nd = 1;
		if(f==0 && d==L) nd=0;

		int nsum = (sum+d)%D;
		ans+=fun(pos+1,nd,nsum,s);
		ans%=mod; 
	}

	return dp[f][sum][pos]=ans;

}	

int main()
{
	memset(dp,-1,sizeof dp);
	string s;cin>>s;
	cin>>D;
	int ans = fun(0,0,0,s)-1;
	ans%=mod;
	if(ans<0) ans+=mod; 
	cout<<ans<<"\n";

	return 0;
}

```