#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long min, temp;
  cin >> temp;
  min = temp;
  for (int i = 1; i < n; i++) {
    cin >> temp;
    if (temp < min) {
      min = temp;
    }
  }
  if (min > 1) {
    cout << "1" << endl;
  } else {
    cout << "-1" << endl;
  }
  return 0;
}
