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;
long long int mod = 998244353;
int tot[2000000];
void merge(int* arr, int start, int middle, int end) {
  int a = start;
  int e = middle + 1;
  int l = end - start + 1;
  int i = 0;
  int temp[l];
  while (a != middle + 1 && e != end + 1) {
    if (*(arr + a) > *(arr + e)) {
      temp[i] = *(arr + e);
      i++;
      e++;
    } else {
      temp[i] = *(arr + a);
      a++;
      i++;
    }
  }
  if (a == middle + 1) {
    while (e != end + 1) {
      temp[i] = *(arr + e);
      i++;
      e++;
    }
  } else {
    while (a != middle + 1) {
      temp[i] = *(arr + a);
      i++;
      a++;
    }
  }
  for (int i = 0; i < l; i++) {
    *(arr + i + start) = temp[i];
  }
}
int mergesort(int* arr, int start, int end) {
  if (start == end) {
    return 1;
  }
  int m = (start + end) / 2;
  mergesort(arr, start, m);
  mergesort(arr, m + 1, end);
  merge(arr, start, m, end);
  return 1;
}
int main() {
  int n;
  scanf("%d", &n);
  int arr[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  mergesort(arr, 0, n - 1);
  for (int i = 0; i < 2000000; i++) {
    tot[i] = 0;
  }
  long long int sum = 1;
  int current = arr[0];
  int totnum = 0;
  for (int i = 1; i < n; i++) {
    if (arr[i] == current) {
      sum++;
    } else {
      tot[sum - 1]++;
      totnum++;
      sum = 1;
    }
    current = arr[i];
  }
  tot[sum - 1]++;
  totnum++;
  long long int ans = 0;
  ans += tot[0];
  totnum -= tot[0];
  for (int i = 1; i < 2000000; i++) {
    sum = 0;
    sum += ((i) * ((tot[i] * (tot[i] - 1)) / 2)) % mod;
    sum += tot[i] * 2;
    totnum -= tot[i];
    if (totnum == 0) {
      break;
    }
    sum += (((tot[i] * totnum) % mod) * (i)) % mod;
    sum = sum % mod;
    ans = ans + sum;
    ans = ans % mod;
  }
  printf("%I64d\n", ans);
}
