#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  scanf("%d", &n);
  for (int i = (1), _b = (n); i <= _b; i++) {
    int x;
    scanf("%d", &x);
    if (x == 1) {
      cout << -1 << endl;
      return 0;
    }
  }
  cout << 1 << endl;
}
