import std;

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

    long x = 1;
    long m = 10L ^^ 18;
    foreach (e; a) {
        long y = x * e;
        if (y < x) return -1;
        if (y > m) return -1;
        x = y;
    }
    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;
