from collections import defaultdict IsPrime = [True for _ in range(10**5 + 1)] IsPrime[0] = IsPrime[1] = False Primes = [] for i in range(2, 10**5 + 1): if IsPrime[i]: Primes.append(i) for j in range(i * i, 10**5 + 1, i): IsPrime[j] = False n, k = map(int, input().split()) mod = 10**9 + 7 P = defaultdict(int) seen = set() for prime in Primes: while n % prime == 0: seen.add(prime) P[prime] += 1 n //= prime C = [(p, c) for p, c in P.items()] while not (len(seen) <= 2 and (2 in seen or 3 in seen)) and k > 0: k -= 1 P = defaultdict(int) seen = set() for p, c in C: p += 1 if IsPrime[p]: seen.add(p) P[p] += c else: for prime in Primes: while p % prime == 0: seen.add(prime) P[prime] += c p //= prime if p == 1: break C = [(p, c) for p, c in P.items()] if k > 0: q, r = divmod(k, 2) P = defaultdict(int) for p, c in C: if p == 2: if r == 0: P[2] += c * pow(2, q, mod - 1) else: P[3] += c * pow(2, q + 1, mod - 1) else: if r == 0: P[3] += c * pow(2, q, mod - 1) else: P[2] += c * pow(2, q + 1, mod - 1) C = [(p, c) for p, c in P.items()] ans = 1 for p, c in C: ans *= pow(p, c, mod) ans %= mod print(ans)