#include <bits/stdc++.h>
using namespace std;
const int SZ = 26;
const int maxn = 3e5 + 5;
const int mod = 998244353;
long long qpow(long long x, long long y) {
  long long ans = 1;
  x %= mod;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long fac[maxn], fav[maxn], dp[maxn], a[maxn], pos[maxn];
int n;
void init() {
  fac[0] = fav[0] = 1;
  for (int i = 1; i < maxn; i++) fac[i] = fac[i - 1] * i % mod;
  fav[maxn - 1] = qpow(fac[maxn - 1], mod - 2);
  for (int i = maxn - 2; i >= 1; i--) fav[i] = fav[i + 1] * (i + 1) % mod;
}
long long A(int n, int m) { return fac[n] * fav[n - m] % mod; }
void upd(long long &x, long long y) {
  x = y;
  if (x >= mod) x %= mod;
}
int main() {
  init();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  int l = 0;
  for (int i = 1; i <= n; i++) {
    while (l < n && a[l + 1] * 2 <= a[i]) l++;
    pos[i] = l;
  }
  if (pos[n] != n - 1) {
    printf("0\n");
    return 0;
  }
  dp[0] = 1;
  pos[0] = -1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= pos[i]; j++) {
      upd(dp[i], dp[i] + dp[j] * A(n - 2 - pos[j], pos[i] - pos[j] - 1));
    }
  }
  printf("%lld\n", dp[n]);
}
