ll pow(ll x, ll y, ll mod) { if (y == 0)return 1; return (((y & 1) ? x : 1) * pow(x*x%mod, y >> 1, mod)) % mod; }