program main
integer(16), allocatable :: x(:)
integer(16) :: N,S,A,F
A = 10**18_16
read *,N
allocate(x(N))
read *,x
F=0
do i = 1, N, 1
if( x(i) == 0) then
	F = 1
    S = 0
    exit
end if
end do


if( F == 0 ) then
S = x(1)
do i = 2, N, 1
S = S * x(i)
if ( S > A ) then
	S = -1
    exit
end if
end do
end if

print '(i0)',S
end program main