//https://ncode.syosetu.com/n4830bu/251/ #include #include using boost::multiprecision::cpp_int; using namespace std; using ll = long long; const ll mod = 129402307; int main() { cpp_int N, M; cin >> N >> M; N %= mod; M %= (mod - 1); cpp_int ans = 1; if (N == 0 && M == 0) ans = 0; while (M) { if (M % 2 == 1) { ans *= N; ans %= mod; } N *= N; N %= mod; M /= 2; } cout << ans << endl; }