import std;

BigInt calc(long[] a) {
    if (a.any!(e => e == 0)) return BigInt(0);

    BigInt x = 1;
    long m = 10L ^^ 18;
    foreach (e; a) {
        x *= e;
        if (x > m) return BigInt(-1);
    }
    return x;
}

void main() {
    int n; scan(n);
    auto a = reads!long;
    writeln(calc(a));
}

void scan(T...)(ref T a) {
    string[] ss = readln.split;
    foreach (i, t; T) a[i] = ss[i].to!t;
}
T read(T=string)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readints = reads!int;
