      PROGRAM piyo
      IMPLICIT NONE
      INTEGER,PARAMETER :: prec = 16
      integer(prec) :: n,ans,i
      integer(prec),allocatable :: a(:)
      
      read*,n
      allocate( a(n) )
      read*,a(1:n)
      
      if( count(a==0)>=1 )then
        print*,0
        stop
      end if
      
      ans = a(1)
      do i = 2,n
        ans = ans * a(i)
        if( ans>10_prec**18_prec )then
          print*,'-1'
          stop
        end if
      end do
      
      print*,ans
      
      
      
      stop
      !debugg
      
      
      
      END PROGRAM