#!/usr/local/gnu/bin/bash
max=1000000000000000000
read n
read -a a
a=(`echo ${a[@]} | tr ' ' '\n' | sort -nr`)
if((a[n-1]==0))
then
    echo 0
    exit
fi
m=1
for x in ${a[@]}
do
    if((max/m<x))
    then
        echo -1
        exit
    else
        m=$((m*x))
    fi
done
echo $m
