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