from sys import stdin input = stdin.readline p, k = map(int, input().split()) print((pow(10, p-1) + (p-k-1)) // p % 1000000007)