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

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

read_N_data(N) ->
    P = lists:flatten(lists:duplicate(N, "~d")),
    {ok, L} = io:fread("", P),
    L.