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
// Elementary Number Theory - Power
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_1_B
using System;
using System.Linq;
using System.Collections.Generic;

namespace NTL_1_B {
	class Program {
        const uint mod = 1000000007;
		public Program() {}
		
		public static void Main() {
			new Program().Calc();
		}
		
		void Calc() {
			var n = Input.Split(' ')
					     .Select(i => uint.Parse(i))
					     .ToArray();
			Output(power(n[0], n[1]).ToString());
		}
		
		String Input {
			get {
				return Console.ReadLine();
			}
		}
		
		void Output(String str) {
			Console.WriteLine(str);
		}
		
		uint power(uint n, uint m) {
            if(m == 0) return 1;
            if(m % 2 == 0) return power(n * n % mod, m / 2);
            return power(n, m -1) * n % mod;
		}
	}
}