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