#include <bits/stdc++.h>
using namespace std;
int n[1000];
int main() {
  int n, m;
  while (scanf("%d", &n) != EOF) {
    int f = 0;
    for (int i = 0; i <= n; i++) {
      scanf("%d", &m);
      if (m == 1) f = 1;
    }
    if (f)
      printf("-1\n");
    else
      printf("1\n");
  }
  return 0;
}
