#!/bin/bash
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

result=1

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

echo $result
