def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) if arr==[]: arr.append([n, 1]) return arr from collections import defaultdict MOD = 10**9+7 N, K = map(int, input().split()) dp = defaultdict(int) F = factorization(N) for p, e in F: dp[p] += e dp[p] %= MOD #print(dp) for k in range(K): ndp = defaultdict(int) flag = 1 for p in dp: e = dp[p] y = factorization(p+1) for yp, ye in y: ndp[yp] += ye*e ndp[yp] %= (MOD-1) if yp>=4: flag = 0 dp = ndp if flag: break #print(dp) if flag: nokori = K-(k+1) e2 = dp[2] * pow(2, (nokori//2), MOD-1) % (MOD-1) e3 = dp[3] * pow(2, (nokori//2), MOD-1) % (MOD-1) if nokori%2==1: e3, e2 = e2, e3*2%(MOD-1) ans = pow(2, e2, MOD) * pow(3, e3, MOD) % MOD print(ans) else: ans = 1 for p in dp: e = dp[p] ans *= (p**e)%MOD ans %= MOD print(ans)