#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
const long long INF = 1LL << 60;
const long long mod = 1e9 + 7;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
long long modinv(long long a, long long mod) {
  long long b = mod, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= mod;
  if (u < 0) u += mod;
  return u;
}
template <const long long md>
struct ntt {
  inline void add(long long &a, long long b) {
    a += b;
    if (a >= md) a -= md;
  }
  inline void sub(long long &a, long long b) {
    a -= b;
    if (a < 0) a += md;
  }
  inline long long mul(long long a, long long b) {
    return (long long)((long long)a * b % md);
  }
  inline long long power(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
      if (b & 1) res = mul(res, a);
      a = mul(a, a);
      b >>= 1;
    }
    return res;
  }
  inline long long inv(long long a) {
    a %= md;
    if (a < 0) a += md;
    long long b = md, u = 0, v = 1;
    while (a) {
      long long t = b / a;
      b -= t * a;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    assert(b == 1);
    if (u < 0) u += md;
    return u;
  }
  long long max_base, root;
  vector<long long> dw, idw;
  ntt() {
    long long tmp = md - 1;
    max_base = 0;
    while (tmp % 2 == 0) {
      tmp /= 2;
      max_base++;
    }
    root = 2;
    while (power(root, (md - 1) >> 1) == 1) root++;
    dw.resize(max_base);
    idw.resize(max_base);
    for (long long i = 0; i < max_base; i++) {
      sub(dw[i], power(root, (md - 1) >> (i + 2)));
      idw[i] = inv(dw[i]);
    }
  }
  void fft(vector<long long> &a, bool inv) {
    const long long n = a.size();
    assert((n & (n - 1)) == 0);
    assert(__builtin_ctz(n) <= max_base);
    if (!inv) {
      for (long long m = n; m >>= 1;) {
        long long w = 1;
        for (long long s = 0, k = 0; s < n; s += 2 * m) {
          for (long long i = s, j = s + m; i < s + m; ++i, ++j) {
            long long x = a[i], y = mul(a[j], w);
            a[j] = (x >= y ? x - y : x + md - y);
            a[i] = (x + y >= md ? x + y - md : x + y);
          }
          w = mul(w, dw[__builtin_ctz(++k)]);
        }
      }
    } else {
      for (long long m = 1; m < n; m *= 2) {
        long long w = 1;
        for (long long s = 0, k = 0; s < n; s += 2 * m) {
          for (long long i = s, j = s + m; i < s + m; ++i, ++j) {
            long long x = a[i], y = a[j];
            a[j] = (x >= y ? x - y : x + md - y);
            a[j] = mul(a[j], w);
            a[i] = (x + y >= md ? x + y - md : x + y);
          }
          w = mul(w, idw[__builtin_ctz(++k)]);
        }
      }
    }
  }
  vector<long long> multiply(vector<long long> a, vector<long long> b,
                             long long eq = 0) {
    long long need = a.size() + b.size() - 1;
    long long nbase = 0;
    while ((1 << nbase) < need) nbase++;
    long long sz = 1 << nbase;
    a.resize(sz);
    b.resize(sz);
    fft(a, 0);
    if (eq)
      b = a;
    else
      fft(b, 0);
    long long inv_sz = inv(sz);
    for (long long i = 0; i < sz; i++) {
      a[i] = mul(mul(a[i], b[i]), inv_sz);
    }
    fft(a, 1);
    a.resize(need);
    return a;
  }
  vector<long long> square(vector<long long> a) { return multiply(a, a, 1); }
};
const long long MOD = 998244353;
ntt<MOD> NTT;
long long n;
vector<long long> h;
long long fact[200200];
long long finv[200200];
long long com(long long n, long long k) {
  if (n < k || n < 0 || k < 0) return 0;
  return (fact[n] * finv[k] % MOD) * finv[n - k] % MOD;
}
void solve() {
  fact[0] = 1;
  for (long long i = 1; i < 200200; ++i) {
    fact[i] = fact[i - 1] * i % MOD;
  }
  finv[0] = 1;
  for (long long i = 1; i < 200200; ++i) {
    finv[i] = finv[i - 1] * modinv(i, MOD) % MOD;
  }
  cin >> n;
  h.resize(2 * n);
  for (long long i = 0; i < 2 * n; i++) {
    cin >> h[i];
  }
  sort(h.begin(), h.end());
  static long long cnt[100100];
  for (long long i = 0; i < 100100; i++) cnt[i] = 0;
  for (long long i = 0; i < 2 * n; i++) {
    cnt[h[i]]++;
  }
  static long long co[100100];
  for (long long i = 0; i < 100100; i++) co[i] = 0;
  for (long long i = 0; i < 100100; i++) {
    co[cnt[i]]++;
  }
  static long long cc[200200];
  for (long long i = 0; i < 200200; i++) cc[i] = 0;
  cc[0] = 1;
  for (long long i = 2; i <= 2 * n; i += 2) {
    cc[i] = cc[i - 2] * com(i, 2) % MOD;
  }
  long long ans = cc[2 * n] * finv[n];
  vector<long long> dp(100200, 0);
  dp[0] = 1;
  vector<long long> crse(100200, 0);
  vector<long long> crso(100200, 0);
  crse[0] = 1, crso[0] = 1;
  for (long long i = 2; i < 100100; ++i) {
    long long k = i / 2;
    if (i % 2 == 0) {
      crse[k] = crse[k - 1] * com(2 * k, 2) * finv[k] % MOD * fact[k - 1] % MOD;
      for (long long j = 0; j < co[i]; j++) {
        dp = NTT.multiply(dp, crse);
      }
    } else {
      crso[k] =
          crso[k - 1] * com(2 * k + 1, 2) * finv[k] % MOD * fact[k - 1] % MOD;
      for (long long j = 0; j < co[i]; j++) {
        dp = NTT.multiply(dp, crso);
      }
    }
    dp.resize(100100);
  }
  for (long long i = 1; i <= n; ++i) {
    if (i % 2 == 1) {
      ans = ans + MOD - dp[i] * cc[2 * n - 2 * i] % MOD * finv[n - i] % MOD;
      ans %= MOD;
    } else {
      ans = ans + dp[i] * cc[2 * n - 2 * i] % MOD * finv[n - i] % MOD;
      ans %= MOD;
    }
  }
  cout << ans % MOD << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
