#include <bits/stdc++.h>
using namespace std;
int n, a[100005], r;
bool chk[100005];
int main() {
  scanf("%d", &n);
  r = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    if (a[i] > r) {
      printf("%d\n", i);
      return 0;
    }
    if (a[i] <= n) chk[a[i]] = true;
    while (chk[r]) r++;
  }
  puts("-1");
  return 0;
}
