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