import java.util.*;
import java.lang.*;
import java.math.BigInteger;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz