#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  set<int> ase;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (ase.size() >= x) {
      ase.insert(x);
    } else {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}
