#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  long long int max = -1;
  unordered_map<long long int, long long int> m;
  bool v = true;
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] > max + 1) {
      ans = i + 1;
      v = false;
      break;
    } else {
      if (a[i] > max) {
        max = a[i];
      }
    }
  }
  if (v) {
    cout << "-1\n";
  } else {
    cout << ans << "\n";
  }
  return 0;
}
