#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 123;
const long long INF = 1e18 + 123;
const double eps = 1e-9;
const int mod = 1e9 + 7;
void boost() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
}
int n, x, otv;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    if (x == 1) {
      otv = 1;
    }
  }
  if (otv == 1) {
    cout << -1;
  } else {
    cout << 1;
  }
  return 0;
}
