#include <bits/stdc++.h>
using namespace std;
int isop(int a, int b, int c, int d, int x, int y) {
  if (a == x + c && ((b == y && b >= d) || (b == d && b >= y)))
    return 1;
  else
    return -1;
}
int main() {
  int n, k = 0;
  cin >> n;
  int a[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) k++;
  }
  if (k == 0)
    cout << 1;
  else
    cout << -1;
}
