#include <iostream>

const int MOD=1e9+7;

void addmod(int& x,int y){
  x=(x+y)%MOD;
}

int dp[100];
int tmp[100];

int main(){
  std::string K;
  int D;
  std::cin>>K>>D;
  int prefix=0;
  for(char c:K){
    for(int rem=0;rem<D;rem++){
      for(int d=0;d<10;d++){
	addmod(tmp[(rem+d)%D],dp[rem]);
      }
    }
    for(int rem=0;rem<D;rem++){
      dp[rem]=tmp[rem];
      tmp[rem]=0;
    }
    for(int d=0;d<c-'0';d++){
      addmod(dp[(prefix+d)%D],1);
    }
    prefix=(prefix+(c-'0'))%D;
  }
  printf("%d\n",(dp[0]+MOD-(prefix!=0))%MOD);
  return 0;
}

### 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 <iostream>

const int MOD=1e9+7;

void addmod(int& x,int y){
  x=(x+y)%MOD;
}

int dp[100];
int tmp[100];

int main(){
  std::string K;
  int D;
  std::cin>>K>>D;
  int prefix=0;
  for(char c:K){
    for(int rem=0;rem<D;rem++){
      for(int d=0;d<10;d++){
	addmod(tmp[(rem+d)%D],dp[rem]);
      }
    }
    for(int rem=0;rem<D;rem++){
      dp[rem]=tmp[rem];
      tmp[rem]=0;
    }
    for(int d=0;d<c-'0';d++){
      addmod(dp[(prefix+d)%D],1);
    }
    prefix=(prefix+(c-'0'))%D;
  }
  printf("%d\n",(dp[0]+MOD-(prefix!=0))%MOD);
  return 0;
}

```