program main
integer(8), allocatable :: x(:)
integer(8) :: N,S,A
A = 10**18_8
read *,N
allocate(x(N))
read *,x
S = 1
do i = 1, N
S = S * x(i)
end do

if ( S > A ) then
	S = -1
end if
print '(i0)',S
end program main