package main import ( "fmt" ) func main() { var N, M int fmt.Scan(&N, &M) fmt.Println(pow(N,M)) } // 繰り返し二乗法 // http://judge.u-aizu.ac.jp/onlinejudge/commentary.jsp?id=NTL_1_B // O(log(2)n) const MOD = 129402307 func pow(x, n int)int{ tmp := 1 if n>0{ tmp = pow(x, n/2) if n%2 ==0{ tmp=(tmp*tmp)%MOD }else{ tmp=(((tmp*tmp)%MOD)*x)%MOD } } return tmp }