#include <bits/stdc++.h>
using namespace std;
long long n, i, j, L, m, k, t, sum = 0, cnt, a[100009], d, rem, mod, mx, mn, v,
                               r, l;
string s, s1;
map<long long, long long> _mp;
vector<long long> v1, v2, v3;
vector<long long> v4[51];
set<long long> st;
set<long long>::iterator it;
int main() {
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  if (a[0] != 0)
    cout << 1 << endl;
  else {
    _mp[0] = 1;
    for (i = 0; i < n; i++) {
      if (_mp[a[i]] == 1)
        _mp[a[i] + 1] = 1;
      else {
        cout << i + 1 << endl;
        return 0;
      }
    }
    cout << -1 << endl;
  }
}
