#include #define rep(i, a, n) for(int i = a; i < (n); i++) using namespace std; using ll = long long; using P = pair; const int INF = 1001001001; const ll LINF = 1001002003004005006ll; const int mod = 1000000007; //const int mod = 998244353; // POWER_MODver. N^k % MOD ll mod_pow(ll n, ll k){ ll res = 1; for(; k > 0; k >>= 1){ if(k&1) res = (res*n)%mod; n = (n*n)%mod; } return res; } int main() { ll a, b; cin >> a >> b; cout << mod_pow(a, b) << endl; return 0; }