#include <bits/stdc++.h>
using namespace std;
int n, a[2000001];
map<long long, long long> fix;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (a[1] != 0) {
    cout << 1 << endl;
    return 0;
  }
  fix[0] = 1;
  int i;
  for (i = 2; i <= n; i++)
    if (fix[a[i] - 1] == 0 && fix[a[i]] == 0) {
      cout << i << endl;
      return 0;
    } else
      fix[a[i]]++;
  cout << -1 << endl;
}
