#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, c = 0, ind, max1 = 0;
  cin >> n;
  int a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (a[0] != 0) {
    cout << 1;
    exit(0);
  }
  for (long long i = 1; i < n; i++) {
    if (a[i] > max1 + 1) {
      c = 1;
      ind = i;
      break;
    }
    max1 = max(max1, a[i]);
  }
  if (c == 0) {
    cout << -1;
  } else {
    cout << ind + 1;
  }
}
