#include <bits/stdc++.h>
using namespace std;
int a[1000001];
int main() {
  int n, i, unfortunate = 1;
  cin >> n;
  for (i = 1; i <= n; ++i) {
    cin >> a[i];
    if (a[i] == 1) unfortunate = -1;
  }
  cout << unfortunate;
  return 0;
}
