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