#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  bool *arr = new bool[n + 1];
  long int num;
  memset(arr, false, sizeof(bool) * (n + 1));
  arr[0] = true;
  scanf("%ld", &num);
  if (num != 0) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 1; i < n; ++i) {
    scanf("%ld", &num);
    if (num > n) {
      cout << i + 1 << endl;
      return 0;
    }
    if (num == 0) continue;
    if (arr[num - 1] == true)
      arr[num] = true;
    else {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
