import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd mod = 10**9+7 def fact(n): l = [] tmp = n for i in range(2,int(pow(n,0.5))+1): if tmp % i == 0: cnt = 0 while tmp % i == 0: cnt += 1 tmp //= i l.append([i,cnt]) if tmp != 1: l.append([tmp,1]) return l def f(p, cnt): if cnt == 0: return p pf = fact(p) ans = 1 for i in pf: if i[0] != 2: ans *= pow(f(i[0]+1,cnt-1), i[1], mod) else: if cnt % 2 == 0: ans *= pow(pow(2, pow(2,cnt//2, mod-1), mod), i[1], mod) else: ans *= pow(pow(3, pow(2,cnt//2, mod-1), mod), i[1],mod) ans %= mod return ans def gu(p, cnt): for i in range(cnt): new = 1 pf = fact(p) for i in pf: new*= pow(i[0]+1 , i[1]) p = new return p%mod n,k = map(int,input().split()) print(f(n,k)%mod)