program mainb
  implicit none
  integer(8)::n,i
  real(8),allocatable::a(:)
  real(8)::ans

   read*,n
   allocate(a(n))

  read*,a
  print*,a


  ans=1
  do i=1,n
   ans=a(i)*ans
   print*,ans
   
  end do

if (ans>1000000000000000000.0) then
     ans=-1
   end if
  
200 print*,int(ans)

end program mainb
