import std.algorithm;
import std.array;
import std.conv;
import std.string;
import std.stdio;

void main() {
    int n = readln.chomp.to!int;
    long[] a = readln.split.map!(to!long).array;
    long res = 1L;

    foreach(item; a) {
        if(item == 0L) {
            0.writeln;
            return;
        }
    }

    foreach(item; a) {
        res *= item;
        if(res > (10L)^^18) {
            (-1).writeln;
            return;
        }
    }

    res.writeln;
}

