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