#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, a, lim = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a;
    if (a > lim) {
      cout << i << endl;
      return 0;
    }
    if (a == lim) lim++;
  }
  cout << -1 << endl;
  return 0;
}
