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