#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) #include using mint = atcoder::modint1000000007; int main() { ll n, k; cin >> n >> k; vector> pf(0); for (int i = 2; i * i <= n; ++i) { if (n % i == 0) { pf.push_back({ i, 0 }); while (n % i == 0) { n /= i; pf.back().second++; } } } if (n > 1) pf.push_back({ n, 1 }); while (pf.size() > 2 && k > 0) { --k; map new_pf; new_pf[2] = new_pf[3] = 0; for (auto [p, e] : pf) { if (p == 2) new_pf[3] += e; else if (p == 3) new_pf[2] += 2 * e; else { assert(p % 2 == 1); ll new_p = p + 1; while (new_p % 2 == 0) { new_p /= 2; new_pf[2] += e; } assert(new_p % 2 == 1); if (new_p != 1) { new_pf[new_p] += e; } } } pf.clear(); for (auto [p, e] : new_pf) { pf.push_back({ p, e }); } } mint ans = 1; for (auto [p, e] : pf) { ans *= mint(p + (k % p)).pow((e * mint(2).pow(k / p)).val()); } cout << ans.val() << endl; return 0; }