package yukicoder; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main{ public static void main(String[] args)throws Exception{ new Main().solve(); } int mod=1000000007; void solve(){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=sc.nextInt(); Prime prime=new Prime(); ArrayList primeList=prime.primeList(1000000000); HashMap>hm=new HashMap<>(); for(int i=0;i al=hm.get(f.base); if(al==null){ al=new ArrayList<>(); } al.add(f.exp); hm.put(f.base, al); } } long ans=1; for(Map.Entry> e:hm.entrySet()){ ArrayList al=e.getValue(); al.sort(Collections.reverseOrder()); int max=Math.min(k,al.size()); int sum=0; for(int i=0;i=1){ if(n%2==0){ pow=pow*pow; pow%=mod; n/=2; }else if(n%2==1){ ans*=pow; ans%=mod; n--; } } return ans; } void tr(Object...o){System.out.println(Arrays.deepToString(o));} class Prime{ boolean[] isPrimeArray(int max){ boolean[] isPrime=new boolean[max+1]; Arrays.fill(isPrime, true); isPrime[0]=isPrime[1]=false; for(int i=2;i*i<=max;i++){ if(isPrime[i]){ for(int j=2;j*i<=max;j++){ isPrime[j*i]=false; } } } return isPrime; } ArrayList primeList(int max){ boolean[] isPrime=isPrimeArray(max); ArrayList primeList=new ArrayList(); for(int i=2;i<=max;i++){ if(isPrime[i]){ primeList.add(i); } } return primeList; } ArrayList primeFactorF(ArrayList primeList,long num){ ArrayList ret=new ArrayList(); for(int p:primeList){ int exp=0; while(num%p==0){ num/=p; exp++; } if(exp>0)ret.add(new Factor(p,exp)); } return ret; } } class Factor{ int base,exp; Factor(int base,int exp){ this.base=base; this.exp=exp; } } }