#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int nxt = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x <= nxt) {
      if (x == nxt) nxt = x + 1;
    } else {
      cout << i + 1 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
