# input
read N
read -a A

# check if there is 0 in A
declare flag=false

for (( i = 0; i < N; i++ )); do
  if [ ${A[i]} -eq 0 ]; then flag=true; break; fi
done

if "$flag"; then echo "0"; exit 0; fi

# calculate
declare -i ans=1

for (( i = 0; i < N; i++ )); do
  if [ $ans -gt $(( 10**18 / A[i] )) ]; then echo "-1"; exit 0; fi
  ans=$(( ans * A[i] ))
done

echo $ans