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