#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  long long m = -1;
  int i;
  for (i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a > m + 1) break;
    m = max(m, a);
  }
  cout << (i == n ? -1 : i + 1) << endl;
  return 0;
}
