import java.util.*;
import java.math.*;
import java.io.*;
public class Main {
 
	public static void main(String[] args) throws Exception{
		int num = 998244353;
 
		// TODO Auto-generated method stub
 		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
 		PrintWriter out = new PrintWriter(System.out);
//	 	
 		int n = Integer.parseInt(bf.readLine());
 		StringTokenizer st = new StringTokenizer(bf.readLine());
 		ArrayList<BigInteger> array = new ArrayList<BigInteger>();
 		boolean found = false;
 		for(int i = 0;i<n;i++){
 			array.add(new BigInteger(st.nextToken()));
 			if (array.get(i).equals(new BigInteger("0"))){
 				out.println(0);
 				out.close();
 				found = true;
 			}
 		}
 		if (found == false){
	 		BigInteger prod = new BigInteger("1");
	 		
	 		boolean found1 = true;
	 		for(int i = 0;i<n;i++){
	 			prod = prod.multiply(array.get(i));
	 			if (prod.compareTo(new BigInteger("1000000000000000000")) > 0){
	 				out.println(-1);
	 				found1 = false;
	 				break;
	 			}
	 		}
	 		if (found1 == true){
	 			out.println(prod);
	 		}
 		}
 		out.close();
 		
 		
 		
 	}
}

/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