#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  if (a[0] != 0)
    cout << 1 << endl;
  else {
    int mx = 0;
    int i = 1;
    while (i < n) {
      if (a[i] > mx + 1) break;
      mx = max(mx, a[i]);
      i++;
    }
    if (i < n)
      cout << i + 1 << endl;
    else
      cout << -1 << endl;
  }
  return 0;
}
