package yukicoder; import java.math.BigInteger; import java.util.Arrays; import java.util.Scanner; public class Main{ public static void main(String[] args)throws Exception{ new Main().solve(); } final long mod=1_000_000_000+7; void solve(){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); Long k=sc.nextLong(); long ansS=0,ansF=0; long[][] a=new long[n+1][1]; for(int i=0;i=0){ if((b.remainder(BigInteger.valueOf(10)).compareTo(BigInteger.valueOf(1)))==0){ B=MtPrd(A,B,mod); b=b.subtract(BigInteger.valueOf(1)); b=b.divide(BigInteger.valueOf(10)); }else if((b.remainder(BigInteger.valueOf(10)).compareTo(BigInteger.valueOf(1)))!=0){ b=b.divide(BigInteger.valueOf(10)); } A=MtPrd(A,A,mod); } return B; } long[][] MtPrd(long[][] A,long[][] B,long mod){ long[][] C=new long[A.length][B[0].length]; for(int i=0;i