#include <bits/stdc++.h>
using namespace std;
double a[100005];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  double x = 1, mx = 0;
  for (int i = n; i >= 1; i--) {
    if (mx * (1 - a[i]) + x * a[i] < mx)
      break;
    else
      mx = mx * (1 - a[i]) + x * a[i], x *= 1 - a[i];
  }
  printf("%.12lf", mx);
}
