-module('Main').
-export([main/1]).

main(_) ->
    {ok, [N]} = io:fread("", "~d"),
    Ans = read_N_data(N, 1),
    case Ans > 1000000000000000000 of
        true ->
            io:format("-1~n");
        false ->
            io:format("~p~n", [Ans])
    end,
    halt().

read_N_data(0, Acc) ->
    Acc;
read_N_data(N, Acc) ->
    {ok, [X]} = io:fread("", "~d"),
    NewAcc = X * Acc,
    case NewAcc == 0 of
        true ->
            io:format("0~n"),
            halt();
        false ->
            read_N_data(N - 1, X * Acc)
    end.