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;
int n, c[3000500];
long long a[200500 << 2], tag[200500 << 2];
inline void up(int num) {
  a[num] = (a[num << 1] + a[num << 1 | 1]) % 998244353;
}
inline void ladd(int num) {
  if (tag[num] != 1) {
    a[num << 1] = a[num << 1] * tag[num] % 998244353;
    tag[num << 1] = tag[num << 1] * tag[num] % 998244353;
    a[num << 1 | 1] = a[num << 1 | 1] * tag[num] % 998244353;
    tag[num << 1 | 1] = tag[num << 1 | 1] * tag[num] % 998244353;
    tag[num] = 1;
  }
}
int wfl, wfr, to;
long long wfc;
void add(int l = 1, int r = n, int num = 1) {
  if (l == r) {
    a[num] = (a[num] + wfc) % 998244353;
    return;
  }
  int mid = (l + r) >> 1;
  ladd(num);
  if (to <= mid)
    add(l, mid, num << 1);
  else
    add(mid + 1, r, num << 1 | 1);
  up(num);
}
void tim(int l = 1, int r = n, int num = 1) {
  if (wfl <= l && r <= wfr) {
    a[num] = a[num] * wfc % 998244353;
    tag[num] = tag[num] * wfc % 998244353;
    return;
  }
  int mid = (l + r) >> 1;
  ladd(num);
  if (wfl <= mid) tim(l, mid, num << 1);
  if (mid < wfr) tim(mid + 1, r, num << 1 | 1);
  up(num);
}
long long ret;
void qry(int l = 1, int r = n, int num = 1) {
  if (wfl <= l && r <= wfr) {
    ret = (ret + a[num]) % 998244353;
    return;
  }
  int mid = (l + r) >> 1;
  ladd(num);
  if (wfl <= mid) qry(l, mid, num << 1);
  if (mid < wfr) qry(mid + 1, r, num << 1 | 1);
}
void dfs(int l = 1, int r = n, int num = 1) {
  if (l == r) {
    ret = (ret + a[num] * l) % 998244353;
    return;
  }
  int mid = (l + r) >> 1;
  ladd(num);
  dfs(l, mid, num << 1);
  dfs(mid + 1, r, num << 1 | 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 1, num; i <= n; i++) {
    scanf("%d", &num);
    c[num]++;
  }
  int cnt = 0;
  for (int i = 1; i <= 3000000; i++)
    if (c[i]) {
      cnt++;
      wfl = c[i];
      wfr = n;
      ret = 0;
      qry();
      wfc = ret + 1;
      to = c[i];
      add();
      wfl = 1;
      wfr = c[i] - 1;
      if (wfl <= wfr) tim();
    }
  ret = 0;
  dfs();
  long long buf = 1;
  for (int i = 1; i <= cnt; i++) buf = (buf << 1) % 998244353;
  ret = (ret - n - buf + cnt + cnt + 1 + 233ll * 998244353) % 998244353;
  printf("%I64d\n", ret);
  return 0;
}
