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