require 'prime' N, K = gets.split.map(&:to_i) MOD = 10 ** 9 + 7 def ff(a, k) return a if k <= 0 nums = a.prime_division res = 1 nums.each do |v, e| res *= (v + 1).pow(e) end ff(res, k - 1) end def f(a, k) return a if k <= 0 nums = a.prime_division if nums.last[0] <= 3 && nums.size == 2 cnt_2 = nums[0][1] cnt_3 = nums[1][1] d = k / 2 cnt_2 = (cnt_2 * 2.pow(d, MOD - 1)) % (MOD - 1) cnt_3 = (cnt_3 * 2.pow(d, MOD - 1)) % (MOD - 1) if k % 2 != 0 cnt_2, cnt_3 = 2 * cnt_3, cnt_2 end return (2.pow(cnt_2, MOD) * 3.pow(cnt_3, MOD)) % MOD elsif nums.last[0] == 2 cnt = nums[0][1] d = k / 2 cnt = (cnt * 2.pow(d, MOD - 1)) % (MOD - 1) if k % 2 == 0 return 2.pow(cnt, MOD) else return 3.pow(cnt, MOD) end end res = 1 nums.each do |v, e| res *= (v + 1).pow(e) end f(res, k - 1) end # pp ff(N, K) % MOD pp f(N, K) % MOD