// cum is the only solution #include #ifndef LOCAL #define debug(...) 0 #else #include "../template/debug.cpp" #endif using namespace std; using ll = int_fast64_t; const int MOD = 1e9 + 7; ll pow(ll a, ll b, ll m){ ll res = 1; while(b){ if(b & 1) res = (res * a) % m; a = (a * a) % m; b /= 2; } return res; } int main(){ cin.tie(0) -> sync_with_stdio(0); ll a,b; cin >> a >> b; cout << MOD << endl; cout << pow(a, b, MOD) << endl; }