ll p;
ll kmul(ll a,ll b){ ll ans=0; for(;b;) { if(b&1) ans=(ans+a)%p; a<<=1; a%=p; b>>=1; } return ans%p;}