#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 100, N = 2e5 + 5;
const long long INF = 1e18 + 100, MOD = 1e9 + 7;
long long powmod(long long a, long long b, long long m = MOD) {
  long long r = 1;
  while (b > 0) {
    if (b & 1) r = r * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return r;
}
long long power(long long a, long long b) {
  long long r = 1;
  while (b > 0) {
    if (b & 1) r = r * a;
    a = a * a;
    b >>= 1;
  }
  return r;
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long inv(long long a, long long m = MOD) { return powmod(a, m - 2, m); }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int a[N];
map<int, int> mp;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0),
      cout << setprecision(10) << fixed;
  ;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  if (a[0] != 0) {
    cout << 1;
    return 0;
  }
  mp[a[0]]++;
  mp[-1]++;
  for (int i = 1; i < n; ++i) {
    if (!mp[a[i] - 1]) {
      cout << i + 1 << "\n";
      return 0;
    }
    mp[a[i]]++;
  }
  cout << -1;
}
