#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
const int N = 106;
int n;
double p[N], now, fac;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lf", &p[i]);
  sort(p + 1, p + n + 1);
  now = 0;
  fac = 1;
  if (fabs(p[n] - 1) < eps) {
    printf("1.0\n");
    return 0;
  }
  for (int i = n; i > 0; i--) {
    if (now >= 1) break;
    now += p[i] / (1 - p[i]);
    fac = fac * (1 - p[i]);
  }
  printf("%.14f", fac * now);
}
