#include <bits/stdc++.h>
using namespace std;
inline int qread() {
  int x = 0;
  char c = getchar(), o = ' ';
  while (c < '0' || c > '9') o = c, c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (o == '-') x = ~x + 1;
  return x;
}
long long qpow(long long x, int k) {
  long long sum = 1;
  while (k) {
    if (k & 1) sum = (sum * x) % 998244353;
    x = (x * x) % 998244353;
    k = k >> 1;
  }
  return sum;
}
long long f[100010], a[100010], mx[1000010], inv[1000010], fa[1000010];
long long A(int x, int y) { return (fa[x] * inv[x - y]) % 998244353; }
int main() {
  int n = qread();
  for (register int i = 1; i <= n; ++i) {
    a[i] = qread();
  }
  sort(a + 1, a + 1 + n);
  fa[0] = 1;
  for (register int i = 1; i <= n; ++i) fa[i] = (fa[i - 1] * i) % 998244353;
  inv[n] = qpow(fa[n], 998244353 - 2);
  inv[0] = 1;
  for (register int i = n - 1; i >= 1; --i)
    inv[i] = (inv[i + 1] * (i + 1)) % 998244353;
  int k = 0;
  for (register int i = 1; i <= n; ++i) {
    while (a[k] <= a[i] / 2) k++;
    mx[i] = k - 1;
  }
  f[0] = 1;
  mx[0] = -1;
  for (register int i = 1; i <= n; ++i) {
    for (register int j = 0; j <= mx[i]; ++j) {
      f[i] = (f[i] + f[j] * A(n - mx[j] - 2, mx[i] - mx[j] - 1)) % 998244353;
    }
  }
  if (mx[n] != n - 1)
    cout << "0\n";
  else
    cout << f[n] << '\n';
  return 0;
}
