program ABC169_B
  integer(16)::N,ans=1
  integer(16),allocatable::A(:)
  read(*,*)N
  allocate(A(N))
  read(*,*)A
  do i=1,N
     if(A(i)==0) then
        write(*,*)'0'
        stop
     end if
  end do
  do i=1,N
     ans=ans*A(i)
     if(ans>10_16**18_16) then
        write(*,*)'-1'
        stop
     end if
  end do
  write(*,*)ans
end program ABC169_B