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