program main
integer(8) :: n,ans=1
integer(8), allocatable :: a(:)
integer, parameter :: lk = selected_int_kind(15)
read(*,*) n
allocate(a(n))
read(*,*)(a(i),i=1,n)
do i = 1,n
ans = ans * a(i)
end do
if (ans > 1000000000000000000_lk) then
write(*,*) -1
else
write(*,*) ans 
end if 
end program