#include <bits/stdc++.h>
using namespace std;
void testing(int position = 0) {
  static clock_t clock_tStart;
  if (position == 0) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    clock_tStart = clock();
  } else {
    printf("\n\nTime taken: %fs\n\n",
           (double)(clock() - clock_tStart) / CLOCKS_PER_SEC);
  }
}
void real_main();
int main() {
  real_main();
  return 0;
}
void real_main() {
  int n, a;
  cin >> n;
  int mini = 2000000000;
  while (n--) {
    cin >> a;
    mini = min(mini, a);
  }
  mini -= 1;
  if (mini == 0)
    mini = -1;
  else
    mini = 1;
  cout << mini << endl;
}
