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) {
        res *= item;
        if(res > 10^^18) {
            res = -1;
            break;
        }
    }
    res.writeln;
}

