program kk
	implicit none
    integer(16), allocatable :: a(:)
    integer(16) :: n, i
    integer(16) :: s
    read(*,*) n
    allocate(a(n))
    read(*,*) a
    s = 1
    do i = 1, n
    	s = s * a(i)
        if (s > 1e+18) then
        	stop
        end if
    end do 
    write(*,*) s

    deallocate(a)

end program kk