#include #include #include #include #include #include using namespace std; using i32 = int; using u32 = unsigned int; using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; using Modint = atcoder::static_modint<1000000007>; vector pf(int n){ vector res; for(int p=2; p*p<=n; p++){ while(n%p == 0){ res.push_back(p); n /= p; } } if(n != 1) res.push_back(n); return res; } int main(){ i64 N, K; cin >> N >> K; map mp; for(int x : pf(N)) mp[x] += 1; while(K){ if(mp.size() == 1 && mp.begin()->first == 2) break; K--; map buf; for(auto [p,c] : mp) for(int q : pf(p+1)) buf[q] += c; for(auto& q : buf) q.second %= 1000000006; swap(mp, buf); } if(K == 0){ Modint ans = 1; for(auto [p,c] : mp) ans *= Modint(p).pow(c); cout << ans.val(); } else{ i64 q = atcoder::static_modint<1000000006>(2).pow(K/2).pow(mp[2]).val(); K %= 2; if(K % 2 == 0) cout << Modint(2).pow(q).val() << endl; else cout << Modint(3).pow(q).val() << endl; } return 0; }