#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100005];
map<long long, bool> check;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  cin >> n;
  for (long long i = (1); i <= (n); ++i) cin >> a[i];
  check[0] = 1;
  for (long long i = (1); i <= (n); ++i) {
    if (check[a[i]])
      check[a[i] + 1] = 1;
    else
      return cout << i, 0;
  }
  cout << -1;
  return 0;
}
