#include using namespace std; using ll=long long; using pii=pair; #define all(a) a.begin(),a.end() #define pb push_back #define sz(a) ((int)a.size()) const int N=100005; const int mod=1000000007; int add(int x, int y){x+=y; if(x>=mod) x-=mod; return x;} int sub(int x, int y){x-=y; if(x<0) x+=mod; return x;} int mul(int x, int y){return ((ll)x)*y%mod;} int fpow(int x, ll y, int m){int res=1; for(; y; x=1ll*x*x%m,y>>=1) if(y&1) res=1ll*res*x%m; return res;} vector pr; int lpd[N]; void sieve(){ pr.clear(); for(int i=0; i=N) break; lpd[p*i]=p; if(i%p==0) break; } } } vector factors(int x){ vector res; while(x>1) res.pb(lpd[x]),x/=lpd[x]; return res; } int n; vector cnt; ll k; signed main(){ ios_base::sync_with_stdio(0),cin.tie(0); sieve(); cin >> n >> k; auto vec=factors(n); cnt.resize(vec.back()+1); for(auto p: vec) cnt[p]++; while(cnt.back()==0) cnt.pop_back(); while(k){ if(sz(cnt)<=4){ cnt.resize(4); if(k&1){ int res1=fpow(3,1ll*cnt[2]*fpow(2,k/2,mod-1)%(mod-1),mod); int res2=fpow(2,1ll*cnt[3]*fpow(2,(k+1)/2,mod-1)%(mod-1),mod); cout << mul(res1,res2) << "\n"; return 0; } else{ int res1=fpow(2,1ll*cnt[2]*fpow(2,k/2,mod-1)%(mod-1),mod); int res2=fpow(3,1ll*cnt[3]*fpow(2,k/2,mod-1)%(mod-1),mod); cout << mul(res1,res2) << "\n"; return 0; } } vector ncnt(sz(cnt)+1); for(int i=2; i0){ auto vec=factors(i+1); for(auto p: vec) ncnt[p]+=cnt[i]; } cnt=ncnt; while(cnt.back()==0) cnt.pop_back(); k--; } int res=1; for(int i=2; i0) res=mul(res,fpow(i,cnt[i],mod)); cout << res << "\n"; }