atcoder#DPS. Digit Sum

Digit Sum

Score : 100100 points

Problem Statement

Find the number of integers between 11 and KK (inclusive) satisfying the following condition, modulo 109+710^9 + 7:

  • The sum of the digits in base ten is a multiple of DD.

Constraints

  • All values in input are integers.
  • 1K<10100001 \leq K < 10^{10000}
  • 1D1001 \leq D \leq 100

Input

Input is given from Standard Input in the following format:

KK

DD

Output

Print the number of integers satisfying the condition, modulo 109+710^9 + 7.

30
4
6

Those six integers are: 4,8,13,17,224, 8, 13, 17, 22 and 2626.

1000000009
1
2

Be sure to print the number modulo 109+710^9 + 7.

98765432109876543210
58
635270834