#include <bits/stdc++.h>
int N;
double a[100];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%lf", a + i);
  std::sort(a, a + N, [](double a, double b) { return a > b; });
  if (a[0] > 0.9999995) {
    puts("1.000000000000");
    return 0;
  }
  double A = 0, B = 1;
  for (int i = 0; i < N && A < 1; i++) {
    A += a[i] / (1 - a[i]);
    B *= 1 - a[i];
  }
  printf("%.12lf\n", A * B);
  return 0;
}
