#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long second = -1, t = 1;
  bool flag = true;
  for (long long i = 0; i < n; i++) {
    if (a[i] > second + 1) {
      flag = false;
      break;
    }
    second = max(second, a[i]);
    t++;
  }
  if (flag)
    cout << -1 << endl;
  else
    cout << t << endl;
}
