program main
integer(16), allocatable :: x(:)
integer(16) :: N,S,A
A = 10**18_16
read *,N
allocate(x(N))
read *,x
S = x(1)
do i = 2, N, 1
S = S * x(i)
end do
 
if ( S > A ) then
	S = -1
end if
print '(i0)',S
end program main