#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] > cnt) {
      cout << i;
      return 0;
    }
    if (a[i] == cnt) cnt++;
  }
  cout << -1;
  return 0;
}
