#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, i, flag = 0;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (a[0] != 0) {
    cout << "1";
    return 0;
  }
  int last = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] <= last) {
      last = max(last, a[i]);
      continue;
    } else if ((a[i] - last) == 1) {
      last = a[i];
      continue;
    } else if ((a[i] - last) > 1) {
      cout << (i + 1);
      flag = 1;
      break;
    }
  }
  if (flag == 0) cout << "-1";
}
