p, k = map(int, input().split()) n = 10 ** (p - 1) - k - 1 MOD = 10 ** 9 + 7 ans = 0 if n >= 0: ans = (n // p + 1) % MOD print(ans)