#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  map<long long, bool> pm;
  if (a.front()) return cout << 1 << '\n', 0;
  pm[1] = true;
  pm[0] = true;
  for (long long i = 1; i < n; ++i) {
    long long k = a[i];
    if (!pm[k]) return cout << i + 1 << '\n', 0;
    pm[k + 1] = true;
  }
  cout << -1 << '\n';
}
