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