import sys input=lambda: sys.stdin.readline().rstrip() p,k=map(int,input().split()) mod=10**9+7 pp=pow(10,p-1,p*mod) print((pp//p)%mod)