#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define rep(i, n) for (int i = 0; i < (n); i++) #define coutf(f) cout << fixed << setprecision(f) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() const int mod = 1000000007; ll pow(ll x, ll n) { ll ret = 1; while (n > 0) { if (n & 1) ret = ret * x % mod; x = x * x % mod; n >>= 1; } return ret; } int main() { ll a, n; cin >> a >> n; cout << mod << endl; cout << pow(a, n) << endl; return 0; }