#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k;
  int nxt = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> k;
    if (k > nxt) {
      cout << i + 1 << endl;
      return 0;
    } else if (k == nxt)
      nxt++;
  }
  cout << -1 << endl;
  return 0;
}
