import sys input = sys.stdin.readline from collections import Counter N,K=map(int,input().split()) mod=10**9+7 # エラトステネスの篩を用いた素因数分解・約数列挙 MAX=10**6+10 # 使いたい最大値を指定 # Sieve[i]で、iの最も小さい約数を返す。 Sieve=[i for i in range(MAX)] for i in range(2,MAX): if Sieve[i]!=i: continue for j in range(i,MAX,i): if Sieve[j]==j: Sieve[j]=i # 素因数分解 def fact(x): if x==1: return {1:1} D=dict() while x!=1: k=Sieve[x] if k in D: D[k]+=1 else: D[k]=1 x//=k return D # 約数列挙 def faclist(x): LIST=[1] while x!=1: k=Sieve[x] count=0 while x%k==0: count+=1 x//=k LIST2=[] for l in LIST: for i in range(1,count+1): LIST2.append(l*k**i) LIST+=LIST2 return LIST ANS=1 NOW=fact(N) while K and len(NOW)!=0: NNOW=Counter() for c in NOW: a=c+1 D=fact(a) for d in D: if d==2: q=(K-1)//2 r=(K-1)%2 if r==0: ANS=ANS*pow(pow(2,pow(2,q,1000000006),mod)%mod,D[d]*NOW[c],mod) else: ANS=ANS*pow(pow(3,pow(2,q,1000000006),mod)%mod,D[d]*NOW[c],mod) else: NNOW[d]+=D[d]*NOW[c] NNOW[d]%=mod NOW=NNOW K-=1 for c in NOW: ANS=ANS*pow(c,NOW[c],mod)%mod print(ANS)