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