#!/bin/bash
result=1
max=`echo 10^18 | bc`
read num

read -a input_num

for a in ${input_num[@]}
do
        if [ $a -eq 0 ] ; then
                echo 0
                exit
	fi	

done


for a in ${input_num[@]}
do
	result=`echo $result \* $a | bc`
	
	if [ $result -ge $max ] ; then
		result=-1
		break
	fi
done

echo $result
