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


void main() {
	ulong r = 1;
	enum ulong RMax = 1000000000000000000UL;
	enum ulong EMax = 100000UL;

	readln;
	auto a = readln.chomp.split(' ').map!(to!ulong).array;

	foreach (e;a) {
		if (e == 0) {
			writeln("0");
			return;
		}
	}

	foreach (e;a) {
		if ((r / EMax) * e > (RMax / EMax)) {
			writeln("-1");
			return;
		}
		r *= e;
	}

	if (r > RMax) {
		writeln("-1");
	} else {
		writeln(r);
	}
}
