#include <bits/stdc++.h>
using namespace std;
const int maxint = ((~((unsigned)(0))) >> 1);
const long long maxll = ((~((unsigned long long)(0))) >> 1);
const int inf = 0x3f3f3f3f;
const double PI = acos(-1.0);
const int N = 105;
double dp[N][N];
double solve(int n, double a[]) {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  double ans = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      double tmp1, tmp2;
      if (j > 0 && (i - 1 >= j - 1))
        tmp1 = dp[i - 1][j - 1] * a[i];
      else
        tmp1 = 0;
      if (j <= i - 1)
        tmp2 = dp[i - 1][j] * (1 - a[i]);
      else
        tmp2 = 0;
      dp[i][j] = tmp1 + tmp2;
      if (j == 1) ans = max(ans, dp[i][j]);
    }
  }
  return ans;
}
int main() {
  double a[N];
  int n;
  scanf("%d", &(n));
  for (int i = 1; i <= n; ++i) scanf("%lf", &a[i]);
  sort(a + 1, 1 + a + n);
  reverse(a + 1, a + 1 + n);
  double ans = 0;
  ans = max(ans, solve(n, a));
  printf("%.12f\n", ans);
  return 0;
}
