#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const int N = 1e6 + 10;
const long long mod = 998244353;
const long long inf = 8e18;
const int LOG = 22;
long long pw(long long a, long long b, long long M) {
  return (!b ? 1
             : (b & 1 ? (a * pw(a * a % M, b / 2, M)) % M
                      : pw(a * a % M, b / 2, M)));
}
long long dp[N], first[N], I[N];
inline long long E(int r, int n) {
  if (r > n || r < 0) return 0ll;
  return first[n] * I[r] % mod * I[n - r] % mod;
}
int n, A[N], bad[N];
int main() {
  first[0] = 1;
  for (int i = 1; i < N; i++) first[i] = first[i - 1] * i % mod;
  I[N - 1] = pw(first[N - 1], mod - 2, mod);
  for (int i = N - 2; ~i; i--) I[i] = I[i + 1] * (i + 1) % mod;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
  }
  sort(A + 1, A + n + 2);
  n++;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      if (A[j] << 1 > A[i]) bad[i]++;
    }
  }
  dp[1] = 1;
  for (int i = 1; i < n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (A[j] < A[i] << 1) continue;
      int T = bad[i] + j - i - 1 - bad[j];
      int free = n - (i + 1 - bad[i]);
      if (T > free || T < 0) continue;
      dp[j] = (dp[j] + dp[i] * E(T, free) % mod * first[T] % mod) % mod;
    }
  }
  printf("%lld\n", (bad[n] ? 0 : dp[n]));
  return 0;
}
