#include <bits/stdc++.h>
using namespace std;
bool a[1000009];
int main() {
  int n, x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == 1) {
      cout << "-1";
      return 0;
    }
    a[x] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) {
      cout << i;
      return 0;
    }
  }
  cout << "-1";
  return 0;
}
