#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
const long long N = 2e6 + 7;
signed main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  long long cnt = 0;
  map<long long, long long> mp;
  for (long long i = 0; i < n; ++i) {
    if (a[i] == 0) {
      mp[a[i]] = 1;
      continue;
    }
    if (mp[a[i] - 1] < a[i]) {
      cout << i + 1;
      return 0;
    }
    mp[a[i]] = mp[a[i] - 1] + 1;
  }
  cout << -1;
  return 0;
}
