#include <bits/stdc++.h>
using namespace std;
const int maxn = (3e5) + 10, mod = 1e9 + 7;
int n, a[maxn];
map<int, int> mark;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 0;
  int num = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] > num) return cout << i + 1 << endl, 0;
    if (a[i] == num) num++;
  }
  cout << -1 << endl;
  return 0;
}
