#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long double tab[n], m = 0, ilodwr, w;
  for (int i = 0; i < n; i++) {
    cin >> tab[i];
    if (tab[i] > m) m = tab[i];
    if (tab[i] >= 0.5) tab[i] = 0;
  }
  sort(tab, tab + n);
  w = tab[n - 1];
  ilodwr = 1 - tab[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    w = w * (1 - tab[i]) + ilodwr * tab[i];
    ilodwr = ilodwr * (1 - tab[i]);
    if (w > m) m = w;
  }
  cout << setprecision(10) << fixed << m << "\n";
}
