#include <bits/stdc++.h>
using namespace std;
const int md = 998244353;
inline void add(int &a, int b) {
  a += b;
  if (a >= md) a -= md;
}
inline void sub(int &a, int b) {
  a -= b;
  if (a < 0) a += md;
}
inline int mul(int a, int b) { return (int)((long long)a * b % md); }
inline int power(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) {
      res = mul(res, a);
    }
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
inline int inv(int a) { return power(a, md - 2); }
const int N = 77;
int C[N][N];
vector<int> integrate(vector<int> a) {
  vector<int> b = {0};
  for (int i = 0; i < (int)a.size(); i++) {
    b.push_back(mul(a[i], inv(i + 1)));
  }
  return b;
}
void sub(vector<int> &a, vector<int> b) {
  while (a.size() < b.size()) {
    a.push_back(0);
  }
  for (int i = 0; i < (int)b.size(); i++) {
    sub(a[i], b[i]);
  }
}
vector<int> plug(vector<int> a, int delta) {
  vector<int> b(a.size(), 0);
  for (int i = 0; i < (int)a.size(); i++) {
    for (int j = 0; j <= i; j++) {
      add(b[j], mul(a[i], mul(C[i][j], power(delta, i - j))));
    }
  }
  return b;
}
int eval(vector<int> a, int x) {
  int res = 0;
  for (int i = (int)a.size() - 1; i >= 0; i--) {
    res = mul(res, x);
    add(res, a[i]);
  }
  return res;
}
const int COEFF = 1000000;
int main() {
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      C[i][j] =
          (j == 0 ? 1 : (i == 0 ? 0 : (C[i - 1][j] + C[i - 1][j - 1]) % md));
    }
  }
  int n;
  cin >> n;
  vector<int> x(n), fracs;
  for (int i = 0; i < n; i++) {
    double foo;
    cin >> foo;
    x[i] = (int)(foo * COEFF + 0.5);
    fracs.push_back(x[i] % COEFF);
  }
  fracs.push_back(0);
  sort(fracs.begin(), fracs.end());
  fracs.resize(unique(fracs.begin(), fracs.end()) - fracs.begin());
  int cnt = (int)fracs.size();
  vector<int> point(n * cnt + 1);
  for (int i = 0; i <= n * cnt; i++) {
    point[i] = mul(i / cnt * COEFF + fracs[i % cnt], inv(COEFF));
  }
  vector<int> cut(n);
  for (int i = 0; i < n; i++) {
    cut[i] = (int)(find(point.begin(), point.end(), mul(x[i], inv(COEFF))) -
                   point.begin());
  }
  vector<vector<int> > a(n * cnt);
  for (int i = 0; i < n * cnt; i++) {
    a[i] = {i < min(cnt, cut[0]) ? 1 : 0};
  }
  for (int id = 1; id < n; id++) {
    for (int i = 0; i < n * cnt; i++) {
      a[i] = integrate(a[i]);
    }
    for (int i = n * cnt - 1; i >= 0; i--) {
      sub(a[i][0], eval(a[i], point[i]));
      for (int j = i - 1; j >= i - cnt && j >= 0; j--) {
        add(a[i][0], eval(a[j], point[j + 1]));
        if (j > i - cnt) {
          sub(a[i][0], eval(a[j], point[j]));
        } else {
          sub(a[i], plug(a[i - cnt], md - 1));
        }
      }
    }
    for (int i = cut[id]; i < n * cnt; i++) {
      a[i] = {0};
    }
  }
  int ans = 0;
  for (int i = 0; i < n * cnt; i++) {
    vector<int> b = integrate(a[i]);
    add(ans, eval(b, point[i + 1]));
    sub(ans, eval(b, point[i]));
  }
  printf("%d\n", ans);
  return 0;
}
