#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include using namespace std; using namespace atcoder; using ll=long long; void IO(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout<>n; vector x(n); for(ll i=0;i>x[i]; } vector y(n); for(ll i=0;i>y[i]; } sort(x.begin(),x.end()); sort(y.rbegin(),y.rend()); ll left=n,right=n; for(ll i=0;iy[i+1]){ left=i+1; right=n-left; break; } } ll mod=998244353; cout<<(P(left,mod)*P(right,mod))%mod<