p,k=map(int,input().split()) mod=10**9+7 print(((pow(10,p-1)-k)//p+1)%mod)