#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int n, mn = mod;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x = 0;
    cin >> x;
    mn = min(mn, x);
  }
  if (mn == 1)
    cout << "-1";
  else
    cout << "1";
  return 0;
}
