Let's introduce some definitions that will be needed later.

Let prime(x) be the set of prime divisors of x. For example, prime(140) = \{ 2, 5, 7 \}, prime(169) = \{ 13 \}.

Let g(x, p) be the maximum possible integer p^k where k is an integer such that x is divisible by p^k. For example:

  * g(45, 3) = 9 (45 is divisible by 3^2=9 but not divisible by 3^3=27), 
  * g(63, 7) = 7 (63 is divisible by 7^1=7 but not divisible by 7^2=49). 



Let f(x, y) be the product of g(y, p) for all p in prime(x). For example:

  * f(30, 70) = g(70, 2) ⋅ g(70, 3) ⋅ g(70, 5) = 2^1 ⋅ 3^0 ⋅ 5^1 = 10, 
  * f(525, 63) = g(63, 3) ⋅ g(63, 5) ⋅ g(63, 7) = 3^2 ⋅ 5^0 ⋅ 7^1 = 63. 



You have integers x and n. Calculate f(x, 1) ⋅ f(x, 2) ⋅ … ⋅ f(x, n) mod{(10^{9} + 7)}.

Input

The only line contains integers x and n (2 ≤ x ≤ 10^{9}, 1 ≤ n ≤ 10^{18}) — the numbers used in formula.

Output

Print the answer.

Examples

Input


10 2


Output


2


Input


20190929 1605


Output


363165664


Input


947 987654321987654321


Output


593574252

Note

In the first example, f(10, 1) = g(1, 2) ⋅ g(1, 5) = 1, f(10, 2) = g(2, 2) ⋅ g(2, 5) = 2.

In the second example, actual value of formula is approximately 1.597 ⋅ 10^{171}. Make sure you print the answer modulo (10^{9} + 7).

In the third example, be careful about overflow issue.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Arrays;
import java.math.BigInteger;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CPrimesAndMultiplication solver = new CPrimesAndMultiplication();
        solver.solve(1, in, out);
        out.close();
    }

    static class CPrimesAndMultiplication {
        public static final long MODULO = (long) (1e9 + 7);

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            Debug debug = new Debug();
            int X = in.nextInt();
            long n = in.nextLong();
            BigInteger bgn = BigInteger.valueOf(n);
            // get prime divs
            int[] priDivs = enumDivs(X);
            BigInteger ans = BigInteger.ONE;
            for (int p : priDivs) {
                final long cur = p;
                int low = -1;
                int high = 63;
                while (high - low > 1) {
                    int mid = (high + low) >>> 1;
                    BigInteger bigInteger = BigInteger.valueOf(p);
                    bigInteger = bigInteger.pow(mid);
                    if (bigInteger.compareTo(bgn) > 0) {
                        high = mid;
                    } else {
                        low = mid;
                    }
                }
//            debug.tr("1:", low, high);
//            debug.tr("2:", (long) Math.pow(cur, high));
//            debug.tr("3:", n);
//            while (high - low > 1) {
//                int mid = (high + low) >>> 1;
//                if ((long) Math.pow(cur, mid) > n) {
//                    high = mid;
//                } else {
//                    low = mid;
//                }
//            }
                int maxPow = BigInteger.valueOf(cur).pow(high).compareTo(bgn) > 0 ? low : high;
//            debug.tr("4:", cur, maxPow);
//            debug.tr("5:", (long) Math.pow(cur, maxPow));
//            debug.tr("6:", n);

                BigInteger count = BigInteger.ZERO;
                for (int pow = maxPow; pow > 0; --pow) {
                    BigInteger curPow = BigInteger.valueOf(cur).pow(pow);
                    BigInteger times = bgn.divide(curPow);
                    times = times.subtract(count);
//                debug.tr(times, count);
                    BigInteger curAns = curPow.modPow(times, BigInteger.valueOf(MODULO));
//                long curAns = Modular.powerMod(cur % MODULO, times * pow, MODULO);
                    ans = ans.multiply(curAns).mod(BigInteger.valueOf(MODULO));
                    count = count.add(times);
                }
            }
            out.println(ans);
        }

        private int[] enumDivs(int x) {
            int[] pri = new int[200];
            int ptr = 0;
            for (int p = 2; p * p <= x; ++p) {
                if (x % p == 0) {
                    while (x % p == 0) {
                        x /= p;
                    }
                    pri[ptr++] = p;
                }
            }
            if (x != 1) pri[ptr++] = x;
            return Arrays.copyOf(pri, ptr);
        }

    }

    static class Debug {
        PrintWriter out;
        boolean oj;
        long timeBegin;
        Runtime runtime;

        public Debug(PrintWriter out) {
            oj = System.getProperty("ONLINE_JUDGE") != null;
            this.out = out;
            this.timeBegin = System.currentTimeMillis();
            this.runtime = Runtime.getRuntime();
        }

        public Debug() {
            oj = System.getProperty("ONLINE_JUDGE") != null;
            OutputStream outputStream = System.err;
            this.out = new PrintWriter(outputStream);
            this.timeBegin = System.currentTimeMillis();
            this.runtime = Runtime.getRuntime();
        }

        public void finalize() {
            out.flush();
            out.close();
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

