#include <bits/stdc++.h>
using namespace std;
int n;
bool foundOne = false, foundTwo = false;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x == 1) foundOne = true;
  }
  if (foundOne)
    cout << -1;
  else
    cout << 1;
  return 0;
}
