#include <cstdio>

constexpr long long mod = 1000000007;
long long dp[10002][100][2];

int main()
{
  char s[100002];
  int D;
  scanf("%s%d", s, &D);

  dp[0][0][0] = 1;
  int i;
  for (i = 0; s[i]; ++i)
  {
    int d = s[i] - '0';
    for (int j = 0; j < 2; ++j)
    {
      for (int m = 0; m < D; ++m)
      {
        for (int k = 0; k <= (j ? 9 : d); ++k)
        {
          (dp[i + 1][(m + k) % D][j || k < d] += dp[i][m][j]) %= mod;
        }
      }
    }
  }
  printf("%lld\n", (dp[i][0][0] + dp[i][0][1] + mod - 1) % mod);
  return 0;
}
### Prompt

Please formulate 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 <cstdio>

constexpr long long mod = 1000000007;
long long dp[10002][100][2];

int main()
{
  char s[100002];
  int D;
  scanf("%s%d", s, &D);

  dp[0][0][0] = 1;
  int i;
  for (i = 0; s[i]; ++i)
  {
    int d = s[i] - '0';
    for (int j = 0; j < 2; ++j)
    {
      for (int m = 0; m < D; ++m)
      {
        for (int k = 0; k <= (j ? 9 : d); ++k)
        {
          (dp[i + 1][(m + k) % D][j || k < d] += dp[i][m][j]) %= mod;
        }
      }
    }
  }
  printf("%lld\n", (dp[i][0][0] + dp[i][0][1] + mod - 1) % mod);
  return 0;
}
```