#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  set<int> S;
  for (int i = 0; i < n; i++) {
    if (a[i] <= (S.size())) {
    } else {
      cout << i + 1 << endl;
      return 0;
    }
    S.insert(a[i]);
  }
  cout << "-1" << endl;
  return 0;
}
