#include using namespace std; using ll = long long; using P = pair; #define rep(i, n) for(int i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> n; vector a(n); rep(i,n) cin >> a[i]; ll ans; if(n==1) ans = a[0]; else if(n==2) ans = a[0]*a[1]; else if(n%2) ans = 1; else{ set se; rep(i,n) se.insert(a[i]); while(se.size()!=1){ if(se.size()%2){ se.erase(*se.rbegin()); se.erase(*se.rbegin()); se.insert(1); }else{ ll x = *se.begin(); se.erase(x); ll y = *se.begin(); se.erase(y); se.insert(x*y); } } ans = *se.begin(); } cout << ans << endl; return 0; }