import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

immutable int INF = 1 << 29;

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!long).array;
    long m = 0;

    foreach (i; 0..N) {
        if (A[i] > m) {
            writeln(i + 1);
            return;
        }
        if (A[i] == m) {
            m += 1;
        }
    }

    writeln(-1);
}
