#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long Arr[n];
  for (int i = 0; i < n; i++) {
    cin >> Arr[i];
  }
  unordered_map<long long, bool> M;
  bool noMis = true;
  for (int i = 0; i < n; i++) {
    if (Arr[i] == 0) {
      M[0] = true;
    } else if (M.find(Arr[i] - 1) == M.end()) {
      noMis = false;
      cout << i + 1 << endl;
      break;
    } else {
      M[Arr[i]] = true;
    }
  }
  if (noMis) cout << "-1\n";
}
