#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int v[N];
set<int> s;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> v[i];
  if (v[1] != 0) return cout << 1, 0;
  int p(0);
  for (int i = 2; i <= n; ++i) {
    if (p < v[i] - 1) return cout << i, 0;
    s.insert(v[i]);
    while (s.find(p + 1) != s.end()) ++p;
  }
  cout << -1;
  return 0;
}
