You are given an integer x represented as a product of n its prime divisors p_1 ⋅ p_2, ⋅ … ⋅ p_n. Let S be the set of all positive integer divisors of x (including 1 and x itself).

We call a set of integers D good if (and only if) there is no pair a ∈ D, b ∈ D such that a ≠ b and a divides b.

Find a good subset of S with maximum possible size. Since the answer can be large, print the size of the subset modulo 998244353.

Input

The first line contains the single integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of prime divisors in representation of x.

The second line contains n integers p_1, p_2, ..., p_n (2 ≤ p_i ≤ 3 ⋅ 10^6) — the prime factorization of x.

Output

Print the maximum possible size of a good subset modulo 998244353.

Examples

Input


3
2999999 43 2999957


Output


3


Input


6
2 3 2 3 2 2


Output


3

Note

In the first sample, x = 2999999 ⋅ 43 ⋅ 2999957 and one of the maximum good subsets is \{ 43, 2999957, 2999999 \}.

In the second sample, x = 2 ⋅ 3 ⋅ 2 ⋅ 3 ⋅ 2 ⋅ 2 = 144 and one of the maximum good subsets is \{ 9, 12, 16 \}.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
const ll mod = 998244353;
ll mult(ll x, ll y, ll mod) { return (x * y) % mod; }
using cd = complex<ld>;
const long double PI = acosl(-1);
const long double EPS = 1e-6;
void dft(vector<cd> &a, bool invert = false) {
  int n = a.size();
  for (int i = 1, j = 0; i < n; i++) {
    int bit = n >> 1;
    for (; j & bit; bit >>= 1) {
      j ^= bit;
    }
    j ^= bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    long double ang = 2 * PI / len * (invert ? -1 : 1);
    cd wlen(cosl(ang), sinl(ang));
    for (int i = 0; i < n; i += len) {
      cd w(1);
      for (int j = 0; j < len / 2; j++) {
        cd u = a[i + j], v = a[i + j + len / 2] * w;
        a[i + j] = u + v;
        a[i + j + len / 2] = u - v;
        w *= wlen;
      }
    }
  }
  if (invert) {
    for (auto &x : a) {
      x /= n;
    }
  }
}
vector<cd> multiply(vector<cd> a, vector<cd> b) {
  size_t n = (a.size() + b.size() - 1);
  size_t temp = 1;
  for (; temp < n; temp <<= 1)
    ;
  n = temp;
  a.resize(n, 0);
  b.resize(n, 0);
  dft(a);
  dft(b);
  vector<cd> result(n);
  for (int i = 0; i < n; i++) result[i] = a[i] * b[i];
  dft(result, true);
  bool resize_flag = false;
  for (int i = n - 1; i >= 0; i--) {
    if (abs(result[i]) > EPS) {
      result.resize(i + 1);
      resize_flag = true;
      break;
    }
  }
  if (!resize_flag) result.resize(1);
  return result;
}
struct comp {
  bool operator()(const vector<cd> &v1, const vector<cd> &v2) const {
    return v1.size() > v2.size();
  }
};
struct comp2 {
  bool operator()(const vector<ll> &v1, const vector<ll> &v2) const {
    return v1.size() > v2.size();
  }
};
const int MAXN = 3000001;
ll bigmod(ll x, ll p, ll mod) {
  ll ans = 1;
  ll mul = x % mod;
  while (p) {
    if (p & 1) ans = mult(ans, mul, mod);
    mul = mult(mul, mul, mod);
    p >>= 1;
  }
  return ans;
}
ll invmod(ll x, ll mod) { return bigmod(x, mod - 2, mod); }
void ntt(vector<ll> &a, ll mod, ll generator, bool invert = false) {
  int n = a.size();
  ll invn = invmod(n, mod);
  for (int i = 1, j = 0; i < n; i++) {
    int bit = n >> 1;
    for (; j & bit; bit >>= 1) {
      j ^= bit;
    }
    j ^= bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    ll ang = (mod - 1) / len * (invert ? -1 : 1) + (invert ? mod - 1 : 0);
    ll wlen = bigmod(generator, ang, mod);
    for (int i = 0; i < n; i += len) {
      ll w = 1;
      for (int j = 0; j < len / 2; j++) {
        ll u = a[i + j], v = mult(a[i + j + len / 2], w, mod);
        a[i + j] = (u + v) % mod;
        a[i + j + len / 2] = (u - v + mod) % mod;
        w = mult(w, wlen, mod);
      }
    }
  }
  if (invert) {
    for (auto &x : a) {
      x = mult(x, invn, mod);
    }
  }
}
vector<ll> multiply(vector<ll> a, vector<ll> b, ll mod, ll generator) {
  size_t n = (a.size() + b.size());
  size_t temp = 1;
  for (; temp < n; temp <<= 1)
    ;
  n = temp;
  a.resize(n, 0);
  b.resize(n, 0);
  ntt(a, mod, generator);
  ntt(b, mod, generator);
  vector<ll> result(n);
  for (int i = 0; i < n; i++) result[i] = mult(a[i], b[i], mod);
  ntt(result, mod, generator, true);
  return result;
}
int primitive_root(int mod) {
  int phi = mod - 1;
  vector<int> pfactor;
  int i = 2;
  int temp = phi;
  for (; 1LL * i * i <= temp; i++) {
    if (temp % i == 0) {
      pfactor.push_back(phi / i);
      while (temp % i == 0) temp /= i;
    }
  }
  if (temp != 1) pfactor.push_back(phi / temp);
  for (int i = 2; i < mod; i++) {
    bool flag = true;
    for (auto d : pfactor) {
      int g = bigmod(i, d, mod);
      if (g == 1 || g == 0) {
        flag = false;
        break;
      }
    }
    if (flag) return i;
  }
  return -1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<vector<cd>> jedi;
  vector<vector<ll>> prime_adjList;
  int cnt = 0;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    if (mp.find(t) == mp.end()) {
      mp[t] = cnt;
      cnt++;
      jedi.push_back(vector<cd>(2, 1));
      prime_adjList.push_back(vector<ll>(2, 1));
    } else {
      jedi[mp[t]].push_back(1);
      prime_adjList[mp[t]].push_back(1);
    }
  }
  ll gen = primitive_root(mod);
  priority_queue<vector<cd>, vector<vector<cd>>, comp> pq;
  priority_queue<vector<ll>, vector<vector<ll>>, comp2> pq2;
  for (int i = 0; i < jedi.size(); i++) {
    pq.push(jedi[i]);
    pq2.push(prime_adjList[i]);
  }
  while (pq.size() > 1) {
    auto t1 = pq.top();
    pq.pop();
    auto t2 = pq.top();
    pq.pop();
    auto x = multiply(t1, t2);
    for (int i = 0; i < x.size(); i++) {
      ld r = round(x[i].real());
      r = (ll)(r);
      ld im = 0;
      x[i] = cd(r, im);
    }
    pq.push(x);
  }
  while (pq2.size() > 1) {
    auto t1 = pq2.top();
    pq2.pop();
    auto t2 = pq2.top();
    pq2.pop();
    auto x = multiply(t1, t2, mod, gen);
    pq2.push(x);
  }
  ld mx = 0;
  for (int i = 0; i < pq.top().size(); i++) {
    if (pq.top()[mx].real() < pq.top()[i].real()) mx = i;
  }
  ll m = pq2.top()[mx];
  cout << m << "\n";
  return 0;
}
