#include <bits/stdc++.h>
const int maxBufSize = (10000000);
using namespace std;
long long int n;
int main() {
  long long int i, j, a, b, c;
  scanf("%lld", &n);
  b = 0;
  for (i = 1; i <= n; ++i) {
    scanf("%lld", &a);
    if (a == 1) {
      b = 1;
      break;
    }
  }
  if (b == 0) {
    cout << 1;
  } else {
    cout << -1;
  }
  return 0;
}
