#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = -1;
  int k;
  cin >> k;
  if (k != 0)
    ans = 1;
  else {
    for (int i = 2; i <= n; i++) {
      int num;
      cin >> num;
      if (num <= k + 1) {
        k = max(num, k);
      } else {
        ans = i;
        break;
      }
    }
  }
  cout << ans;
}
