#include <bits/stdc++.h>
using namespace std;
template <typename A, typename B>
ostream& operator<<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator<<(ostream& out, const array<T, N>& a) {
  out << "[";
  bool first = true;
  for (auto& v : a) {
    out << (first ? "" : ", ");
    out << v;
    first = 0;
  }
  out << "]";
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
  out << "[";
  bool first = true;
  for (auto& v : a) {
    out << (first ? "" : ", ");
    out << v;
    first = 0;
  }
  out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator<<(ostream& out, const set<T, Cmp>& a) {
  out << "{";
  bool first = true;
  for (auto& v : a) {
    out << (first ? "" : ", ");
    out << v;
    first = 0;
  }
  out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator<<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{";
  bool first = true;
  for (auto& p : a) {
    out << (first ? "" : ", ");
    out << p.first << ":" << p.second;
    first = 0;
  }
  out << "}";
  return out;
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const int INF = 1 << 29;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }
struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;
const int MOD = 998244353;
const int G = 3;
long long power_mod(long long a, long long n, int p = MOD) {
  long long ret = 1;
  for (; n; n >>= 1) {
    if (n & 1) ret = ret * a % p;
    a = a * a % p;
  }
  return ret;
}
long long inv_mod(long long a) { return power_mod(a, MOD - 2); }
void bit_reverse(vector<int>& a) {
  int n = a.size();
  for (int i = 1, j = n / 2; i < n - 1; ++i) {
    if (i < j) swap(a[i], a[j]);
    int k = n / 2;
    while (j >= k) j -= k, k /= 2;
    if (j < k) j += k;
  }
}
void fft(vector<int>& a, int flag) {
  int n = a.size();
  bit_reverse(a);
  vector<int> wn(n);
  wn[0] = 1;
  wn[1] = power_mod(G, flag == 1 ? (MOD - 1) / n : MOD - 1 - (MOD - 1) / n);
  for (int i = 2; i < n; ++i) wn[i] = (long long)wn[i - 1] * wn[1] % MOD;
  for (int k = 2; k <= n; k <<= 1) {
    for (int i = 0; i < n; i += k) {
      int wi = 0, step = n / k;
      for (int j = i; j < i + k / 2; ++j) {
        int u = a[j];
        int v = (long long)wn[wi] * a[j + k / 2] % MOD;
        a[j] = (u + v) % MOD;
        a[j + k / 2] = (u + MOD - v) % MOD;
        wi += step;
      }
    }
  }
  if (flag < 0) {
    long long inv_n = inv_mod(n);
    for (int i = 0; i < n; ++i) a[i] = a[i] * inv_n % MOD;
  }
}
namespace polynomial {
vector<int> mul(const vector<int>& f, const vector<int>& g, int cap = INF) {
  int n = f.size(), m = g.size();
  int len = 1;
  while (len < n + m - 1) len <<= 1;
  vector<int> x(len), y(len);
  copy(f.begin(), f.end(), x.begin());
  copy(g.begin(), g.end(), y.begin());
  fft(x, 1);
  fft(y, 1);
  for (int i = 0; i < len; ++i) x[i] = (long long)x[i] * y[i] % MOD;
  fft(x, -1);
  cap = min(cap, n + m - 1);
  x.resize(cap);
  return x;
}
}  // namespace polynomial
using namespace polynomial;
const int N = 1e5 + 10;
int fact[N], ifact[N], inv[N];
struct comb_init {
  comb_init() {
    inv[1] = 1;
    for (int i = 2; i < N; ++i) {
      inv[i] = (MOD - MOD / i) * (long long)inv[MOD % i] % MOD;
    }
    fact[0] = ifact[0] = 1;
    for (int i = 1; i < N; ++i) {
      fact[i] = (long long)fact[i - 1] * i % MOD;
      ifact[i] = (long long)ifact[i - 1] * inv[i] % MOD;
    }
  }
} comb_init_;
long long comb(int n, int m) {
  if (n < m || m < 0) return 0;
  return (long long)fact[n] * ifact[m] % MOD * ifact[n - m] % MOD;
}
void add(int& x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
vector<int> solve(const vector<vector<int>>& gs, int L, int R) {
  if (L + 1 == R) return gs[L];
  int mid = (L + R) / 2;
  auto u = solve(gs, L, mid);
  auto v = solve(gs, mid, R);
  return mul(u, v);
}
int main() {
  int n;
  cin >> n;
  vector<int> ip2(N), p2(N);
  ip2[0] = p2[0] = 1;
  for (int i = 1; i < N; ++i) {
    ip2[i] = 1LL * ip2[i - 1] * inv[2] % MOD;
    p2[i] = 1LL * p2[i - 1] * 2 % MOD;
  }
  vector<int> a(n * 2);
  for (int i = 0; i < n * 2; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  vector<vector<int>> gs;
  for (int i = 0, j; i < n * 2; i = j) {
    for (j = i; j < n * 2 && a[j] == a[i]; ++j)
      ;
    int k = j - i;
    if (k == 1) continue;
    vector<int> g(k / 2 + 1);
    for (int u = 0; u <= k / 2; ++u) {
      g[u] = 1LL * fact[k] * ifact[k - 2 * u] % MOD * ifact[u] % MOD * ip2[u] %
             MOD;
    }
    gs.push_back(g);
  }
  auto f = solve(gs, 0, (int)((gs).size()));
  42;
  int ret = 0;
  for (int k = 0; k <= n && k < (int)((f).size()); ++k) {
    int cur = f[k] % MOD;
    int cnt = 1LL * fact[2 * n - 2 * k] * ifact[n - k] % MOD * ip2[n - k] % MOD;
    cur = 1LL * cur * cnt % MOD;
    42;
    if (k % 2) cur = MOD - cur;
    add(ret, cur);
  }
  cout << ret << '\n';
  return 0;
}
