#include <bits/stdc++.h>
using namespace std;
int n, Max, Min, a[100005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  Max = Min = a[1];
  if (a[1]) {
    cout << 1;
    return 0;
  } else {
    for (int i = 1; i <= n; i++) {
      if (a[i] >= Min && a[i] <= Max + 1) {
        Min = min(Min, a[i]);
        Max = max(Max, a[i]);
      } else {
        cout << i;
        return 0;
      }
    }
  }
  cout << -1;
  return 0;
}
