#include <atcoder/convolution>
#include <atcoder/modint>
#include <cstdio>

using namespace std;
using namespace atcoder;
using mint = modint998244353;
int cc[100001];
vector<mint> d[1000001];
vector<mint> fac(100001);
vector<mint> inv(100001);
int dn;
mint C(int n, int m) {
    return fac[n] * inv[m] * inv[n - m];
}
int main() {
    int n, m;
    scanf("%d", &n);
    fac[0]=1;
    for(int i = 1; i <= 100000; i++) {
        fac[i] = fac[i-1] * i;
    }
    inv[100000] = fac[100000].inv();
    for(int i = 100000 - 1; i >= 0; i--) {
        inv[i] = inv[i + 1] * (i + 1);
    }
    for(int i = 0; i < 2 * n; i++){
        int x;
        scanf("%d",&x);
        cc[x]++;
    }
    for(int i = 1; i <= 100000; i++) {
        if(cc[i] > 1) {
            d[dn] = vector<mint>(cc[i] / 2 + 1);
            for(int j = 0; j < (int)d[dn].size(); j++) {
                d[dn][j] = C(cc[i], 2 * j) * fac[2 * j] * inv[j];
            }
        }
    }
    int it = 0;
    while(it + 1 < dn) {
        d[dn++] = convolution(d[it], d[it + 1]);
        it += 2;
    }
    mint an;
    for(int i = 0; i < (int)d[it].size(); i++) {
        if(i & 1) {
            an -= d[it][i] * C(n, i) * fac[2 * n - 2 * i] * fac[i];
        } else {
            an += d[it][i] * C(n, i) * fac[2 * n - 2 * i] * fac[i];
        }
    }
    an *= inv[n];
    for(int i = 0; i < n; i++) {
        an *= inv[2];
    }
    printf("%d\n",an.val());
    return 0;
}


