   program abc169b
      implicit none
      integer(8)::n,ans,i
      integer(8),allocatable,dimension(:)::a

         read *, n
         allocate( a(n) )
         read *, a(1:n)

         do i=1,n
            if ( a(i)==0 ) then
               print *, '0'
               stop
            end if
         end do

         ans=a(1)
         do i=2,n
            if ( ans*a(i)>10**18 ) then
               print *, '-1'
               stop
            end if
            ans=ans*a(i)
         end do

         print *, ans
         stop

   end program abc169b