#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k, ans = 0, m = 10000000;
  cin >> n;
  while (n-- > 0) {
    cin >> k;
    if (k == 1) {
      cout << -1;
      return 0;
    }
  }
  cout << 1;
}
