#include using namespace std; constexpr int mod = 1000000007; long long modpow(long long a,long long b) { long long ans = 1; while(b) { if(b & 1) { (ans *= a) %= mod; } (a *= a) %= mod; b /= 2; } return ans; } int main() { int a,n; cin >> a >> n; cout << mod << endl; cout << modpow(a,n) << endl; }