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