#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
long long w[1000010], f[3025][55], inv[65], a[1000010], p[1000010], X[1000010],
    sum[1000010];
int n, m;
long long calc(long long a, long long b, long long mod) {
  long long ans = 1, t = a;
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * t % mod;
    t = t * t % mod;
  }
  return ans;
}
int get(int x) { return lower_bound(p, p + n * m + 1, x) - p; }
int main() {
  inv[1] = 1;
  for (int i = 2; i <= 60; i++) inv[i] = calc(i, mod - 2, mod);
  scanf("%d", &n);
  w[++m] = 0;
  for (int i = 0; i < n; i++) {
    double x;
    scanf("%lf", &x);
    a[i] = (int)(x * 1000000 + 0.01);
    w[++m] = a[i] % 1000000;
  }
  sort(w + 1, w + m + 1);
  m = unique(w + 1, w + m + 1) - w;
  long long inv_1000000 = calc(1000000LL, mod - 2, mod);
  for (int i = n * m; i >= 0; i--) {
    p[i] = (i / m) * 1000000LL + w[i % m];
    if (i < n * m) X[i] = (p[i + 1] - p[i]) * inv_1000000 % mod;
  }
  for (int i = min(get(a[0]), m) - 1; i >= 0; i--) sum[i] = X[i], f[i][1] = 1;
  for (int i = 1; i < n; i++) {
    int cut = get(a[i]);
    for (int j = n * m - 1; j >= 0; j--)
      if (j < cut) {
        for (int k = max(0, j - m); k <= j - 1; k++)
          f[j][0] = (f[j][0] + sum[k]) % mod;
        if (j >= m) {
          for (int k = 0; k <= n; k++)
            f[j][k] = (f[j][k] - f[j - m][k] + mod) % mod;
        }
        for (int k = n - 1; k >= 0; k--)
          f[j][k + 1] = f[j][k] * inv[k + 1] % mod;
        f[j][0] = sum[j] = 0;
        for (int k = n; k >= 0; k--) sum[j] = (sum[j] * X[j] + f[j][k]) % mod;
      } else {
        sum[j] = 0;
        memset(f[j], 0, sizeof(f[j]));
      }
  }
  long long ans = 0;
  for (int i = 0; i < n * m; i++) ans = (ans + sum[i]) % mod;
  printf("%lld\n", ans);
  return 0;
}
