#include <bits/stdc++.h>
using namespace std;
#define eni(x) template < class c > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
template < class c > struct rge { c b, e; };
template < class c > rge<c> range(c i, c j) { return rge<c>{i, j}; }
template < class c > auto dud(c* x) -> decltype(cerr << *x, 0);
template < class c > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; return * this; }
eni(==) return * this << range(begin(i), end(i)); }
template < class c, class b > debug & operator <<(pair < b, c > d) {
  return * this << "(" << d.first << ", " << d.second << ")";
}
template < class c > debug & operator <<(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  return * this << "]";
}
#else
template < class c > debug & operator <<(const c&) { return * this; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define pll pair<ll,ll>
#define pii pair<int,int>
#define all(v) v.begin(),v.end()
#define mod 998244353
#define mx 100005
mt19937 myrand(time(0));

// const int root = 3;
// const int N = 1 << 18;
// int lim, rev[N], w[N], wn[N], inv_lim;
// void reduce(int &x) { x = (x + mod) % mod; }
// int POW(int x, int y, int ans = 1) {
// 	for (; y; y >>= 1, x = (long long) x * x % mod) if (y & 1) ans = (long long) ans * x % mod;
// 	return ans;
// }
// void precompute(int len) {
// 	lim = wn[0] = 1; int s = -1;
//     while (lim < len) lim <<= 1, ++s;
// 	for (int i = 0; i < lim; ++i) rev[i] = rev[i >> 1] >> 1 | (i & 1) << s;
// 	const int g = POW(root, (mod - 1) / lim);
// 	inv_lim = POW(lim, mod - 2);
// 	for (int i = 1; i < lim; ++i) wn[i] = (long long) wn[i - 1] * g % mod;
// }
// void ntt(vector<int> &a, int typ) {
// 	for (int i = 0; i < lim; ++i) if (i < rev[i]) swap(a[i], a[rev[i]]);
// 	for (int i = 1; i < lim; i <<= 1) {
// 		for (int j = 0, t = lim / i / 2; j < i; ++j) w[j] = wn[j * t];
// 		for (int j = 0; j < lim; j += i << 1)
// 			for (int k = 0; k < i; ++k) {
// 				const int x = a[k + j], y = (long long) a[k + j + i] * w[k] % mod;
// 				reduce(a[k + j] += y - mod), reduce(a[k + j + i] = x - y);
// 			}
// 	}
// 	if (!typ) {
//         reverse(a.begin() + 1, a.begin() + lim);
// 		for (int i = 0; i < lim; ++i) a[i] = (long long) a[i] * inv_lim % mod;
// 	}
// }
// vector<int> multiply(vector<int> f, vector<int> g) {
//     if (f.size() > 100000) f.resize(100001);
//     if (g.size() > 100000) g.resize(100001);
//     int n=(int)f.size() + (int)g.size() - 1;
//     precompute(n);
//     vector<int> a = f, b = g;
//     a.resize(lim); b.resize(lim);
//     ntt(a, 1), ntt(b, 1);
//     for (int i = 0; i < lim; ++i) a[i] = (long long) a[i] * b[i] % mod;
//     ntt(a, 0);
//     //while((int)a.size() && a.back() == 0) a.pop_back();
//     return a;
// }

namespace ntt {
    struct num {
        double x, y;
        num() { x = y = 0; }
        num(double x, double y) : x(x), y(y) {}
    };
    inline num operator+(num a, num b) { return num(a.x + b.x, a.y + b.y); }
    inline num operator-(num a, num b) { return num(a.x - b.x, a.y - b.y); }
    inline num operator*(num a, num b) { return num(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x); }
    inline num conj(num a) { return num(a.x, -a.y); }
    int base = 1;
    vector<num> roots = {{0, 0}, {1, 0}};
    vector<int> rev = {0, 1};
    const double PI = acosl(-1.0);
    void ensure_base(int nbase) {
        if (nbase <= base)
            return;
        rev.resize(1 << nbase);
        for (int i = 0; i < (1 << nbase); i++)
            rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (nbase - 1));
        roots.resize(1 << nbase);
        while (base < nbase) {
            double angle = 2 * PI / (1 << (base + 1));
            for (int i = 1 << (base - 1); i < (1 << base); i++) {
                roots[i << 1] = roots[i];
                double angle_i = angle * (2 * i + 1 - (1 << base));
                roots[(i << 1) + 1] = num(cos(angle_i), sin(angle_i));
            }
            base++;
        }
    }
    void fft(vector<num> &a, int n = -1) {
        if (n == -1)
            n = a.size();
        assert((n & (n - 1)) == 0);
        int zeros = __builtin_ctz(n);
        ensure_base(zeros);
        int shift = base - zeros;
        for (int i = 0; i < n; i++)
            if (i < (rev[i] >> shift))
                swap(a[i], a[rev[i] >> shift]);
        for (int k = 1; k < n; k <<= 1) {
            for (int i = 0; i < n; i += 2 * k) {
                for (int j = 0; j < k; j++) {
                    num z = a[i + j + k] * roots[j + k];
                    a[i + j + k] = a[i + j] - z;
                    a[i + j] = a[i + j] + z;
                }
            }
        }
    }
    vector<num> fa, fb;
    vector<int> multiply(vector<int> &a, vector<int> &b) {
        int need = a.size() + b.size() - 1;
        int nbase = 0;
        while ((1 << nbase) < need)
            nbase++;
        ensure_base(nbase);
        int sz = 1 << nbase;
        if (sz > (int)fa.size())
            fa.resize(sz);
        for (int i = 0; i < sz; i++) {
            int x = (i < (int)a.size() ? a[i] : 0);
            int y = (i < (int)b.size() ? b[i] : 0);
            fa[i] = num(x, y);
        }
        fft(fa, sz);
        num r(0, -0.25 / sz);
        for (int i = 0; i <= (sz >> 1); i++) {
            int j = (sz - i) & (sz - 1);
            num z = (fa[j] * fa[j] - conj(fa[i] * fa[i])) * r;
            if (i != j)
                fa[j] = (fa[i] * fa[i] - conj(fa[j] * fa[j])) * r;
            fa[i] = z;
        }
        fft(fa, sz);
        vector<int> res(need);
        for (int i = 0; i < need; i++)
            res[i] = fa[i].x + 0.5;
        return res;
    }
    vector<int> multiply(vector<int> a, vector<int> b, int m, int eq = 0) {
        int need = a.size() + b.size() - 1;
        int nbase = 0;
        while ((1 << nbase) < need)
            nbase++;
        ensure_base(nbase);
        int sz = 1 << nbase;
        if (sz > (int)fa.size())
            fa.resize(sz);
        for (int i = 0; i < (int)a.size(); i++) {
            int x = (a[i] % m + m) % m;
            fa[i] = num(x & ((1 << 15) - 1), x >> 15);
        }
        fill(fa.begin() + a.size(), fa.begin() + sz, num{0, 0});
        fft(fa, sz);
        if (sz > (int)fb.size())
            fb.resize(sz);
        if (eq)
            copy(fa.begin(), fa.begin() + sz, fb.begin());
        else {
            for (int i = 0; i < (int)b.size(); i++) {
                int x = (b[i] % m + m) % m;
                fb[i] = num(x & ((1 << 15) - 1), x >> 15);
            }
            fill(fb.begin() + b.size(), fb.begin() + sz, num{0, 0});
            fft(fb, sz);
        }
        double ratio = 0.25 / sz;
        num r2(0, -1), r3(ratio, 0), r4(0, -ratio), r5(0, 1);
        for (int i = 0; i <= (sz >> 1); i++) {
            int j = (sz - i) & (sz - 1);
            num a1 = (fa[i] + conj(fa[j]));
            num a2 = (fa[i] - conj(fa[j])) * r2;
            num b1 = (fb[i] + conj(fb[j])) * r3;
            num b2 = (fb[i] - conj(fb[j])) * r4;
            if (i != j) {
                num c1 = (fa[j] + conj(fa[i]));
                num c2 = (fa[j] - conj(fa[i])) * r2;
                num d1 = (fb[j] + conj(fb[i])) * r3;
                num d2 = (fb[j] - conj(fb[i])) * r4;
                fa[i] = c1 * d1 + c2 * d2 * r5;
                fb[i] = c1 * d2 + c2 * d1;
            }
            fa[j] = a1 * b1 + a2 * b2 * r5;
            fb[j] = a1 * b2 + a2 * b1;
        }
        fft(fa, sz);
        fft(fb, sz);
        vector<int> res(need);
        for (int i = 0; i < need; i++) {
            ll aa = fa[i].x + 0.5;
            ll bb = fb[i].x + 0.5;
            ll cc = fa[i].y + 0.5;
            res[i] = (aa + ((bb % m) << 15) + ((cc % m) << 30)) % m;
        }
        return res;
    }
    vector<int> square(vector<int> &a, int m) {
        return multiply(a, a, m, 1);
    }
}; // namespace ntt
using namespace ntt;

int n;
int h[mx];
ll fact[mx],inv[mx],f[mx];
vector<int> c[mx];

ll bigmod(ll a, ll p, ll m){
    ll res=1,x=a;
    while(p){
        if(p&1) res=(res*x)%m;
        x=(x*x)%m;
        p=p>>1;
    }
    return res;
}

void precalc(){
    fact[0]=1;
    for(int i=1;i<mx;i++) fact[i]=(fact[i-1]*i)%mod;
    inv[mx-1]=bigmod(fact[mx-1],mod-2,mod);
    for(int i=mx-2;i>=0;i--) inv[i]=(inv[i+1]*(i+1))%mod;
}

ll nCr(ll n, ll r){
    return ((fact[n]*inv[n-r])%mod*inv[r])%mod;
}

bool cmp(vector<int> a, vector<int> b){
    return (int)a.size()<(int)b.size();
}

vector<int> call(int l, int r){
    if(l==r) return c[l];
    int mid=(l+r)>>1;
    return multiply(call(l,mid),call(mid+1,r),mod);
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(),cout.tie();
    precalc();
    cin>>n;
    vector<int> cnt(100002,0);
    for(int i=0;i<2*n;i++){
        cin>>h[i],cnt[h[i]]++;
    }
    f[0]=1;
    for(int i=0;i<=100000;i+=2){
        f[i]=((fact[i]*inv[i/2])%mod*bigmod(bigmod(2,i/2,mod),mod-2,mod))%mod;
    }
    for(int i=1;i<=100000;i++){
        c[i]=vector<int> (cnt[i]+1,0);
        c[i][0]=1;
        for(int j=2;j<=cnt[i];j+=2){
            c[i][j]=(nCr(cnt[i],j)*f[j])%mod;
        }
    }
    vector<int> res=call(1,100000);
    res.resize(2*n+1);
    int ans=0;
    for(int i=0;i<=2*n;i+=2){
        int sgn=(i/2)&1?mod-1:1;
        ll tmp=(res[i]*f[2*n-i])%mod;
        tmp=(tmp*sgn)%mod;
        ans=(ans+tmp)%mod;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 21428