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