#include <bits/stdc++.h>
using namespace std;
long long n, c;
long long arr[100001];
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> arr[i];
  for (long long i = 1; i <= n; i++) {
    if (arr[i] > c) {
      cout << i << endl;
      return 0;
    } else if (arr[i] == c)
      c++;
  }
  cout << -1 << endl;
}
