program mondai2
implicit none
integer*8 i, n, b
integer*8 a(100000)
b = 1
i = 1
read(*,*) n
read(*,*) (a(i), i=1,n)
i = 1
do while (i<=n)
  b = b * a(i)
  i = i + 1
end do
if (dble(b) / 10.0 ** 18.0 > 1) then
  b = -1
end if
write(*,*) int(b)
end program mondai2