#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
void debug(T first) {
  cout << first << "\n";
}
template <typename T, typename... Args>
void debug(T first, Args... args) {
  cout << first << " ";
  debug(args...);
}
long long read_ll() {
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  long long ret = 0;
  int neg = 0;
  if (c == '-') neg = 1, c = getchar();
  while (c >= '0' && c <= '9') {
    ret = 10 * ret + c - 48;
    c = getchar();
  }
  return neg ? -ret : ret;
}
int main() {
  long long n;
  cin >> n;
  long long largest = 0;
  long long ans = -1;
  for (int i = 1; i <= n; i++) {
    long long x;
    cin >> x;
    if (x > largest) {
      if (ans == -1)
        ans = i;
      else
        ans = min(ans, i * 1LL);
    } else {
      largest = max(largest, x + 1);
    }
  }
  cout << ans;
  return 0;
}
