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 (b > 10 ** 18.0) then
  b = -1
end if
write(*,*) b
end program mondai2