#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, max = 0;
  int count = 0, p = -1;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > max && a[i] - max == 1) {
      max = a[i];
    }
    if (a[i] > max && a[i] - max != 1 && count == 0) {
      p = i + 1;
      count = 1;
    }
  }
  if (a[0] != 0)
    cout << "1";
  else
    cout << p;
  return 0;
}
