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