from collections import * MOD = 10 ** 9 + 7 def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a def n_fact(N): c = Counter(prime_factorize(N)) return c N,K = map(int,input().split()) D = n_fact(N) for i in range(K): D2 = defaultdict(int) D2[2] = 0 D2[3] = 0 for k,v in D.items(): DT = n_fact(k + 1) for k2, v2 in DT.items(): D2[k2] += v * v2 D = D2 if D.keys() == {2,3}: break K -= i + 1 if K == 0: ans = 1 for k,v in D.items(): ans *= pow(k,v,MOD) ans %= MOD print(ans) exit() A = [D[2],D[3]] if K & 1: A = [A[1] * 2, A[0]] ans = pow(2,A[0] * pow(2,K//2,MOD-1),MOD) ans *= pow(3,A[1] * pow(2,K//2,MOD-1),MOD) ans %= MOD print(ans)