#include <bits/stdc++.h>
#define int long long
using namespace std;

int dp[100000+1000][2][200];
const int pri=1000000007;

signed main(){
	string S; int D; cin>>S>>D;
	dp[0][0][0]=1;
	int N=S.size();
	for(int i=0;i<N;i++){
		for(int smaller=0;smaller<2;smaller++){
			for(int j=0;j<=D;j++){
				for(int x=0;x<=(smaller ? 9 : S[i]-'0');x++){
					dp[i+1][smaller or x<(S[i]-'0')][(j+x)%D]+=dp[i][smaller][j];
					dp[i+1][smaller or x<(S[i]-'0')][(j+x)%D]%=pri;
				}
			}
		}
	}
	cout<< (dp[N][0][0]+dp[N][1][0]-1 + pri)%pri<<endl;
}

### Prompt

Your task is to create 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>
#define int long long
using namespace std;

int dp[100000+1000][2][200];
const int pri=1000000007;

signed main(){
	string S; int D; cin>>S>>D;
	dp[0][0][0]=1;
	int N=S.size();
	for(int i=0;i<N;i++){
		for(int smaller=0;smaller<2;smaller++){
			for(int j=0;j<=D;j++){
				for(int x=0;x<=(smaller ? 9 : S[i]-'0');x++){
					dp[i+1][smaller or x<(S[i]-'0')][(j+x)%D]+=dp[i][smaller][j];
					dp[i+1][smaller or x<(S[i]-'0')][(j+x)%D]%=pri;
				}
			}
		}
	}
	cout<< (dp[N][0][0]+dp[N][1][0]-1 + pri)%pri<<endl;
}

```