program main
	implicit none
    integer(16)::ans
    integer(8)::n,i
    integer(16),allocatable::a(:)
    read(*,*) n
    allocate(a(n))
    read(*,*)a
    ans=1
    do i=1,n
    	ans=ans*a(i)
    end do
    
    if(ans>10_16**18)then
    	write(*,*) -1
    else
    	write(*,*) ans
    end if
    deallocate(a)
    stop
end program main

