#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  long long n, i;
  cin >> n;
  long long arr[n];
  long long flag = 0;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i] == 1) {
      flag = 1;
    }
  }
  if (flag == 0) {
    cout << "1" << endl;
  } else {
    long long ans;
    cout << "-1" << endl;
  }
}
