#include <bits/stdc++.h>
using namespace std;
int n, a[5005], pos[5005];
long long frac[5005], ifrac[5005], f[5005];
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    (x *= 10) += ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline long long quick_pow(long long x, long long k) {
  long long res = 1;
  while (k) {
    if (k & 1) (res *= x) %= 998244353;
    (x *= x) %= 998244353;
    k >>= 1;
  }
  return res;
}
void init() {
  frac[0] = 1;
  for (int i = 1; i <= n; i++) frac[i] = frac[i - 1] * i % 998244353;
  ifrac[n] = quick_pow(frac[n], 998244353 - 2);
  for (int i = n - 1; i >= 0; i--)
    ifrac[i] = ifrac[i + 1] * (i + 1) % 998244353;
}
inline long long A(int n, int m) { return frac[n] * ifrac[n - m] % 998244353; }
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  init();
  sort(a + 1, a + 1 + n);
  for (int i = 1, p = 0; i <= n; i++) {
    while (p < n && a[i] >= 2 * a[p + 1]) p++;
    pos[i] = p;
  }
  f[0] = 1;
  pos[0] = -1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= pos[i]; j++)
      (f[i] += f[j] * A((n - 1) - (pos[j] + 1), pos[i] - (pos[j] + 1)) %
               998244353) %= 998244353;
  cout << (pos[n] == n - 1 ? f[n] : 0);
  return 0;
}
