#include <bits/stdc++.h>
using namespace std;
const int MIN = 1e3 + 2;
const int MXN = 1e6 + 3;
const int INF = 1e9 + 7;
const double EPS = 1e-9;
const long long LINF = 1e18 + 15;
const long long MOD = 998244353;
int n;
int a;
int pre = -1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a;
    if (a > pre + 1) {
      cout << i;
      return 0;
    }
    pre = max(pre, a);
  }
  cout << -1;
  return 0;
}
