#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, flage = 0, cou, b, c, d;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  d = a[0], cou = a[0];
  for (i = 0; i < n; i++) {
    if (a[0] != 0) {
      flage = 1;
      break;
    } else if (a[i] == cou + 1)
      cou++;
    else if (a[i] > cou + 1 || a[i] < d) {
      b = i;
      flage = 2;
      break;
    }
  }
  if (flage == 1)
    cout << "1"
         << "\n";
  else if (flage == 2)
    cout << b + 1 << "\n";
  else
    cout << "-1"
         << "\n";
  return 0;
}
