#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100 + 10, oo = 1e9 + 10;
const long long M = 1e9 + 7, x = 137;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> used(n + 100);
  int v;
  cin >> v;
  if (v) {
    cout << 1;
    return 0;
  }
  used[v] = 1;
  int last = 0;
  for (int i = 1; i < n; ++i) {
    cin >> v;
    while (used[last]) last++;
    last--;
    if (last + 1 < v) {
      cout << i + 1 << '\n';
      return 0;
    }
    if (v <= n + 5) used[v] = 1;
  }
  cout << "-1\n";
}
