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