#include <bits/stdc++.h>
using namespace std;
long long n;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  if (v[0]) return cout << 1, 0;
  set<long long> st;
  st.insert(0);
  for (long long i = 1; i < n; i++)
    if (st.find(v[i]) != st.end() || v[i] == *st.rbegin() + 1)
      st.insert(v[i]);
    else
      return cout << i + 1, 0;
  cout << -1;
}
