#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
const int mxn = 1e3, mxa = 1e6;
int n;
void solve() {
  cin >> n;
  int mn = mxa + 5;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    mn = min(mn, a);
  }
  if (mn == 1)
    cout << "-1\n";
  else
    cout << "1\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  t = 1;
  while (t--) solve();
}
