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