#include <bits/stdc++.h>
using namespace std;
vector<int> tab;
int x, n;
bool jest;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int a = 1; a <= n; a++) {
    cin >> x;
    if (x == 1) {
      jest = 1;
    }
  }
  if (jest)
    cout << -1;
  else
    cout << 1;
  return 0;
}
