#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 123;
int n, m, k, a[N];
long long p[N], ans, minn;
string s;
map<int, bool> used;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  if (a[1]) return cout << 1, 0;
  used[0] = used[1] = true;
  for (int i = 2; i <= n; ++i) {
    if (used[a[i]])
      used[a[i] + 1] = true;
    else
      return cout << i, 0;
  }
  cout << -1;
  return 0;
}
