#include<iostream> usingnamespace std; typedeflonglong ll; constint mod = 1e9 + 7; constint N = 1e5 + 10; int prime[N]; int tot; ll qpow(ll a, ll b, ll MOD = mod){ ll res = 1; a %= MOD; while (b > 0) { if (b & 1) { res = res * a % MOD; } a = a * a % MOD; b >>= 1; } return res; } intmain(){ ll n, x; cin >> x >> n; ll tmp = x; for (int i = 2; i * i <= tmp; i++) { // 分解x的质因子 if (tmp % i == 0) { prime[tot++] = i; while (tmp % i == 0) tmp /= i; } } if (tmp > 1) prime[tot++] = tmp; ll ans = 1; for (int i = 0; i < tot; i++) { ll y = n, cnt = 0; while (y) { // 计算 1~n 当前质因子出现的次数 y /= prime[i]; cnt += y; } ans = (ans * qpow(prime[i], cnt)) % mod; } cout << ans << endl; return0; }