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();
 		
 		
 		
 	}
} import java.util.*; util.* java import java.math.*; math.* java import java.io.*; io.* java 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();
 		
 		
 		
 	}
} 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();
 		
 		
 		
 	} main {
		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();
 		
 		
 		
 	} int num = 998244353; num 998244353 BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); bf new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int n = Integer.parseInt(bf.readLine()); n Integer.parseInt(bf.readLine()) Integer.parseInt Integer bf.readLine() bf.readLine bf StringTokenizer st = new StringTokenizer(bf.readLine()); st new StringTokenizer(bf.readLine()) ArrayList<BigInteger> array = new ArrayList<BigInteger>(); array new ArrayList<BigInteger>() boolean found = false; 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;
 			}
 		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
 			array.add(new BigInteger(st.nextToken()));
 			if (array.get(i).equals(new BigInteger("0"))){
 				out.println(0);
 				out.close();
 				found = true;
 			}
 		} {
 			array.add(new BigInteger(st.nextToken()));
 			if (array.get(i).equals(new BigInteger("0"))){
 				out.println(0);
 				out.close();
 				found = true;
 			}
 		} array.add(new BigInteger(st.nextToken())) array.add array new BigInteger(st.nextToken()) if (array.get(i).equals(new BigInteger("0"))){
 				out.println(0);
 				out.close();
 				found = true;
 			} array.get(i).equals(new BigInteger("0")) array.get(i).equals array.get(i) array.get array i new BigInteger("0") {
 				out.println(0);
 				out.close();
 				found = true;
 			} out.println(0) out.println out 0 out.close() out.close out found = true 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);
	 		}
 		} found == false 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);
	 		}
 		} BigInteger prod = new BigInteger("1"); prod new BigInteger("1") boolean found1 = true; 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;
	 			}
	 		} int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
	 			prod = prod.multiply(array.get(i));
	 			if (prod.compareTo(new BigInteger("1000000000000000000")) > 0){
	 				out.println(-1);
	 				found1 = false;
	 				break;
	 			}
	 		} {
	 			prod = prod.multiply(array.get(i));
	 			if (prod.compareTo(new BigInteger("1000000000000000000")) > 0){
	 				out.println(-1);
	 				found1 = false;
	 				break;
	 			}
	 		} prod = prod.multiply(array.get(i)) prod prod.multiply(array.get(i)) prod.multiply prod array.get(i) array.get array i if (prod.compareTo(new BigInteger("1000000000000000000")) > 0){
	 				out.println(-1);
	 				found1 = false;
	 				break;
	 			} prod.compareTo(new BigInteger("1000000000000000000")) > 0 prod.compareTo(new BigInteger("1000000000000000000")) prod.compareTo prod new BigInteger("1000000000000000000") 0 {
	 				out.println(-1);
	 				found1 = false;
	 				break;
	 			} out.println(-1) out.println out -1 1 found1 = false found1 false break; if (found1 == true){
	 			out.println(prod);
	 		} found1 == true found1 true {
	 			out.println(prod);
	 		} out.println(prod) out.println out prod out.close() out.close out String[] args args 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();
 		
 		
 		
 	}
} 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();
 		
 		
 		
 	}
} Main
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();
 		
 		
 		
 	}
}
