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 N, K = map(int, input().split()) MOD = 10**9 + 7 for i in range(K): # print(i, N, factorization(N)) ft = factorization(N) c = 1 flag = 1 for n, k in ft: if n != 2 and n != 3: flag = 0 c *= (n + 1) ** k if flag: amari = K - i if len(ft) == 1: if ft[0][0] == 2: ft.append([3, 0]) else: ft.insert(0, [2, 0]) k2, k3 = ft[0][1], ft[1][1] if amari % 2 == 0: two = pow(2, pow(2, amari // 2, MOD) * k2, MOD) three = pow(3, pow(2, amari // 2, MOD) * k3, MOD) else: two = pow(2, pow(2, (amari + 1) // 2, MOD) * k3, MOD) three = pow(3, pow(2, amari // 2, MOD) * k2, MOD) # print(amari, two, three, two * three, pow(2, amari // 2, MOD)) N = (two * three) % MOD break else: N = c print(N % MOD)