#include typedef long long ll; const int YO = 2125212; ll fact[YO]; ll bow[YO]; const int MO = 1<<21; const int MASK = MO-1; void extgcd(ll a,ll b,ll &x,ll &y){ x=1; y=0; if(b!=0){ extgcd(b,a%b,y,x); y -= (a/b) * x; } } ll modinv(ll v){ ll x,y; extgcd(v,MO,x,y); return (x+MO)&MASK; } int main(){ fact[0] = 1; bow[0] = 0; for(int i=1;i