#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  bool f = false;
  for (int x = 0; x < n; x++) {
    cin >> a[x];
    if (a[x] == 1) f = true;
  }
  if (f) {
    cout << -1;
  } else
    cout << 1;
  return 0;
}
