#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}


namespace Poly{
	const int mod = 998244353;
	inline int Add(int a,int b){return a+b>=mod?a+b-mod:a+b;}
	inline int Del(int a,int b){return a>=b?a-b:a+mod-b;}
	inline int power(int a,int b){
		int ret=1;
		for (;b;b>>=1,a=1ll*a*a%mod) if (b&1) ret=1ll*ret*a%mod;
		return ret;
	}
	inline int Get(int x){
		int ret=1;
		while (ret<=x) ret<<=1;
		return ret;
	}
	vector<int>pos,w;
	#define rt register int
	inline void init(int n){
		pos.resize(n),w.resize(n);
		For(i,0,n-1) pos[i]=(pos[i>>1]>>1)|((i&1)*(n>>1));
		for (rt i=1;i<n;i<<=1){
			int wn=power(3,(mod-1)/i/2);w[i]=1;
			For(j,1,i-1) w[j+i]=1ll*w[j+i-1]*wn%mod;
		}
	}
	inline void DFT(poly &F,int n){
		F.resize(n);
		For(i,0,n-1) if (i<pos[i]) swap(F[i],F[pos[i]]);
		for (rt i=1;i<n;i<<=1)   	
            for (rt j=0;j<n;j+=i<<1)
        		for (rt k=0;k<i;k++){
        			int x=F[j+k],y=1ll*F[j+k+i]*w[i+k]%mod;
        			F[j+k]=Add(x,y),F[j+k+i]=Del(x,y);
        		}
	}
	inline void IDFT(poly &F,int n){
		DFT(F,n),reverse(F.begin()+1,F.end());
		for (rt i=0,inv=power(n,mod-2);i<n;i++) F[i]=1ll*F[i]*inv%mod;
	}
	inline poly Mul(poly A,poly B){
		int n=A.size()+B.size()-1,m=Get(n);init(m);
		DFT(A,m),DFT(B,m);
		For(i,0,m-1) A[i]=1ll*A[i]*B[i]%mod;
		return IDFT(A,m),A.resize(n),A;
	}
}


const int N = 1e5+10, mod = 998244353;
int n,a[N],x,mx;

inline int Mod(int x){
	return x>=mod?x-mod:x;
}
inline int power(int a,int b){
	int ret=1;
	for (;b;b>>=1,a=1ll*a*a%mod) if (b&1) ret=1ll*ret*a%mod;
	return ret;
}

int fac[N],ifac[N],pw[N];
inline void init(int n){
	fac[0]=1;
	For(i,1,n) fac[i]=1ll*fac[i-1]*i%mod;
	ifac[n]=power(fac[n],mod-2);
	Dow(i,n-1,0) ifac[i]=1ll*ifac[i+1]*(i+1)%mod;
	pw[0]=1;
	For(i,1,n) pw[i]=1ll*pw[i-1]*(mod+1>>1)%mod;
}
inline int C(int n,int m){
	if (n<m||m<0) return 0;
	return 1ll*fac[n]*ifac[m]%mod*ifac[n-m]%mod;
}

inline poly solve(int l,int r){
	if (l==r){
		poly ans(a[l]+1);
		ans[0]=1;
		for (int i=0;i<=a[l];i+=2) ans[i]=1ll*C(a[l],i)*C(i,i/2)%mod*fac[i/2]%mod*pw[i/2]%mod;
		return ans;
	}
	int mid=l+r>>1;
	return Poly::Mul(solve(l,mid),solve(mid+1,r));
}

int main(){
	n=read();
	For(i,1,2*n) a[x=read()]++,mx=max(mx,x);
	init(2*n);
	poly ret=solve(1,mx);
	int ans=0;
	FOR(i,0,siz(ret)){
		int tmp=1ll*ret[i]*C(2*n-i,(2*n-i)/2)%mod*fac[(2*n-i)/2]%mod*pw[(2*n-i)/2]%mod;
		if ((i/2)&1) ans=Mod(ans+mod-tmp);
			else ans=Mod(ans+tmp);
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 7712