#include <bits/stdc++.h>
using namespace std;
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n, MIN = 1;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  if (arr[0] != 0)
    cout << '1';
  else {
    for (int i = 1; i < n; i++) {
      if (arr[i] == MIN) MIN++;
      if (arr[i] > MIN) {
        cout << i + 1;
        return 0;
      }
    }
    cout << "-1";
  }
  return 0;
}
