#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> mp;
map<long long int, long long int> mp2;
int main() {
  long long int cand, city = 0, max = 0, index, x, joy = -1000000000;
  cin >> cand;
  for (int i = 0; i < cand; i++) {
    cin >> city;
    if (city == 1) max = 1;
  }
  if (max)
    cout << -1;
  else
    cout << 1;
  return 0;
}
