#include <bits/stdc++.h>
using namespace std;
const int maxn = 35;
const int mod = 998244353;
const int INF = int(1e9);
int n;
int inv[maxn], binom[maxn][maxn];
int power(int x, int pow) {
  int res = 1;
  for (; pow; pow >>= 1) {
    if (pow & 1) res = 1LL * res * x % mod;
    x = 1LL * x * x % mod;
  }
  return res;
}
class Poly {
 public:
  vector<int> v;
  Poly() { v.clear(); }
  Poly(int _v) {
    v.clear();
    v.push_back(_v);
  }
  int calc(int x) {
    int cur = 1, res = 0;
    for (int i = 0; i < int(v.size()); i++) {
      res = (res + 1LL * cur * v[i]) % mod;
      cur = 1LL * cur * x % mod;
    }
    return res;
  }
  Poly shift(int d) {
    d = mod - d;
    Poly res;
    res.v.resize(int(v.size()), 0);
    int cur = 1;
    for (int i = 0; i < int(v.size()); i++) {
      for (int j = 0; i + j < int(v.size()); j++)
        res.v[j] =
            (res.v[j] + 1LL * cur * binom[i + j][i] % mod * v[i + j]) % mod;
      cur = 1LL * cur * d % mod;
    }
    return res;
  }
  Poly intg() {
    Poly res;
    if (v.empty()) return res;
    res.v.resize(int(v.size()) + 1, 0);
    for (int i = 0; i < int(v.size()); i++)
      res.v[i + 1] = 1LL * v[i] * inv[i + 1] % mod;
    return res;
  }
  Poly operator-(const Poly &o) const {
    Poly res;
    res.v.resize(max(int(v.size()), int(o.v.size())));
    for (int i = 0; i < int(res.v.size()); i++)
      res.v[i] = ((i < int(v.size()) ? v[i] : 0) + mod -
                  (i < int(o.v.size()) ? o.v[i] : 0)) %
                 mod;
    return res;
  }
  void operator*=(const int &o) {
    for (int i = 0; i < int(v.size()); i++) v[i] = 1LL * v[i] * o % mod;
  }
};
class Func {
 public:
  vector<int> pos;
  vector<Poly> func;
  void init() {
    pos.push_back(0);
    func.push_back(Poly(0));
    pos.push_back(INF);
    func.push_back(Poly(1));
  }
  void integral(int d) {
    int iv = power(d, mod - 2);
    for (int i = 0; i < int(pos.size()); i++) {
      func[i] = func[i].intg();
      if (i)
        func[i] = func[i] - Poly((func[i].calc(pos[i - 1]) + mod -
                                  func[i - 1].calc(pos[i - 1])) %
                                 mod);
    }
    vector<int> npos;
    vector<Poly> nfunc;
    for (int i = 0; i < int(pos.size()); i++) {
      npos.push_back(pos[i]);
      if (pos[i] != INF) npos.push_back(pos[i] + d);
    }
    sort(npos.begin(), npos.end());
    npos.resize(unique(npos.begin(), npos.end()) - npos.begin());
    for (int i = 0; i < int(npos.size()); i++) {
      int pr = lower_bound(pos.begin(), pos.end(), npos[i]) - pos.begin();
      int pl = lower_bound(pos.begin(), pos.end(), npos[i] - d) - pos.begin();
      nfunc.push_back(func[pr] - func[pl].shift(d));
      nfunc.back() *= iv;
    }
    pos = npos;
    func = nfunc;
  }
  void cut(int d) {
    while (int(pos.size()) > 1 && pos[int(pos.size()) - 2] >= d)
      pos.pop_back(), func.pop_back();
    pos.back() = d;
    int cur = func.back().calc(d);
    pos.push_back(INF);
    func.push_back(Poly(cur));
  }
} F;
int main() {
  scanf("%d", &n);
  inv[0] = inv[1] = 1;
  for (int i = 2; i <= n + 1; i++)
    inv[i] = 1LL * inv[mod % i] * (mod - mod / i) % mod;
  binom[0][0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    binom[i][0] = binom[i][i] = 1;
    for (int j = 1; j < i; j++)
      binom[i][j] = (binom[i - 1][j - 1] + binom[i - 1][j]) % mod;
  }
  F.init();
  for (int i = 1; i <= n; i++) {
    double x;
    scanf("%lf", &x);
    F.integral(1000000);
    F.cut(int(x * 1000000 + 0.5));
  }
  printf("%d\n", F.func.back().v[0]);
  return 0;
}
