#include <bits/stdc++.h>
using namespace std;
bool cmp(long long a, long long b) { return a > b; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  set<long long> b;
  b.insert(-1);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    auto it = b.lower_bound(a[i]);
    --it;
    if (a[i] != *it + 1) {
      cout << i + 1 << endl;
      return 0;
    }
    b.insert(a[i]);
  }
  cout << -1 << endl;
  return 0;
}
