For given integers m and n, compute mn (mod 1,000,000,007). Here, A (mod M) is the remainder when A is divided by M.

Constraints

* 1 ≤ m ≤ 100
* 1 ≤ n ≤ 109

Input


m n


Two integers m and n are given in a line.

Output

Print mn (mod 1,000,000,007) in a line.

Examples

Input

2 3


Output

8


Input

5 8


Output

390625
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int powMod(int x, int k, int m) {
    if (k == 0) return 1;
    if (k % 2 == 0) return powMod(x * x % m, k / 2, m);
    return x * powMod(x, k - 1, m) % m;
}

void main() {
    auto mn = readints;
    int m = mn[0], n = mn[1];
    const int mod = 10^^9 + 7;

    auto ans = powMod(m, n, mod);
    writeln(ans);
}
