#include using namespace std; using ll = long long; ll m = 1e9 + 7; ll max_p[100010]; ll mpow(ll md, ll x, ll n) { ll ret = 1; while (n) { if (n % 2) { ret *= x; ret %= md; } x = (x * x) % md; n /= 2; } return ret; } ll calc_ans(ll N, ll K) { if (K == 0) { return N; } if (N == 2) { if (K % 2) { return mpow(m, 3, mpow(m - 1, 2, K / 2)); } else { return mpow(m, 2, mpow(m - 1, 2, K / 2)); } } if (N == 3) { if (K % 2) { return mpow(m, 2, mpow(m - 1, 2, (K + 1) / 2)); } else { return mpow(m, 3, mpow(m - 1, 2, K / 2)); } } ll ret = 1; while (N > 1) { ret *= calc_ans(max_p[(int)N] + 1, K - 1); N /= max_p[(int)N]; } return ret; } int main () { max_p[0] = max_p[1] = 1; for (int i = 2; i <= 100000; i ++) { max_p[i] = -1; } for (int i = 2; i <= 100000; i ++) { if (max_p[i] == -1) { max_p[i] = i; for (int j = 2; j * i <= 100000; j ++) { max_p[i * j] = i; } } } ll N, K; cin >> N >> K; cout << calc_ans(N, K) << endl; }