#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  if (a[0] != 0) {
    cout << 1 << endl;
    return 0;
  }
  priority_queue<long long> pq;
  pq.push(a[0]);
  long long ans = -1;
  for (long long i = 1; i < n; i++) {
    if (a[i] > pq.top() + 1) {
      ans = i + 1;
      break;
    }
    pq.push(a[i]);
  }
  cout << ans << "\n";
  ;
}
