output_description: Print the number of integers satisfying the condition, modulo 10^9 + 7.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K
      D
attempt: K = input()
  D = int(input())
  
  from collections import Counter
  
  rl = Counter()
  r = Counter()
  rl[0] = 1
  
  M = 10**9 + 7
  for c in K:
      d = int(c)
      rln = Counter()
      rn = Counter()
      for rem, count in rl.items():
          rln[(rem + d) % D] += count
          rln[(rem + d) % D] %= M
  
      for rem, count in rl.items():
          for i in range(d):
              rn[(rem + i) % D] += count
              rn[(rem + i) % D] %= M
      for rem, count in r.items():
          for i in range(10):
              rn[(rem + i) % D] += count
              rn[(rem + i) % D] %= M
      rl = rln
      r = rn
  
  print(rl[0] + r[0] - 1)
  
problem_description: Statement
  
  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.
samples: [{"input": "30\n    4", "output": "6\n    \n\nThose six integers are: 4, 8, 13, 17, 22 and 26.\n\n* * *"}, {"input": "1000000009\n    1", "output": "2\n    \n\nBe sure to print the number modulo 10^9 + 7.\n\n* * *"}, {"input": "98765432109876543210\n    58", "output": "635270834"}]