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