#include<bits/stdc++.h> using namespace std; int main() { int a,b,c=0; cin>>a>>b; while(a>0){ c+=6*pow(10,(a-1)); a--; } cout<<(c/b)%1000000007; }