import java.util.*;
import java.math.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt(), zero = 0;
		BigInteger nums[] = new BigInteger[size];
		for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		}
		if(zero > 0){System.out.println("0"); return;}
		BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
		for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java import java.math.*; math.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt(), zero = 0;
		BigInteger nums[] = new BigInteger[size];
		for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		}
		if(zero > 0){System.out.println("0"); return;}
		BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
		for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt(), zero = 0;
		BigInteger nums[] = new BigInteger[size];
		for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		}
		if(zero > 0){System.out.println("0"); return;}
		BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
		for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt(), zero = 0;
		BigInteger nums[] = new BigInteger[size];
		for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		}
		if(zero > 0){System.out.println("0"); return;}
		BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
		for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int size = sc.nextInt() size sc.nextInt() sc.nextInt sc zero = 0; zero 0 BigInteger nums[] = new BigInteger[size]; nums new BigInteger[size] size for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		} int i = 0; int i = 0; i 0 i < size i size i++ i++ i {
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		} {
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		} String str = sc.next(); str sc.next() sc.next sc if(str.equals("0")){zero++;} str.equals("0") str.equals str "0" {zero++;} zero++ zero nums[i] = new BigInteger(str) nums[i] nums i new BigInteger(str) if(zero > 0){System.out.println("0"); return;} zero > 0 zero 0 {System.out.println("0"); return;} System.out.println("0") System.out.println System.out System System.out "0" return; BigInteger base = new BigInteger("1000000000000000000") base new BigInteger("1000000000000000000") ans = BigInteger.ONE; ans BigInteger.ONE BigInteger BigInteger.ONE for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		} BigInteger num nums {
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		} {
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		} if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			} num.compareTo(base) > 0 num.compareTo(base) num.compareTo num base 0 {
				System.out.println("-1"); return;
			} System.out.println("-1") System.out.println System.out System System.out "-1" return; {
				ans = ans.multiply(num);
				base = base.divide(num);
			} ans = ans.multiply(num) ans ans.multiply(num) ans.multiply ans num base = base.divide(num) base base.divide(num) base.divide base num System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt(), zero = 0;
		BigInteger nums[] = new BigInteger[size];
		for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		}
		if(zero > 0){System.out.println("0"); return;}
		BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
		for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		}
		System.out.println(ans);
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt(), zero = 0;
		BigInteger nums[] = new BigInteger[size];
		for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		}
		if(zero > 0){System.out.println("0"); return;}
		BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
		for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
import java.math.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int size = sc.nextInt(), zero = 0;
		BigInteger nums[] = new BigInteger[size];
		for(int i = 0; i < size; i++){
			String str = sc.next();
			if(str.equals("0")){zero++;}
			nums[i] = new BigInteger(str);
		}
		if(zero > 0){System.out.println("0"); return;}
		BigInteger base = new BigInteger("1000000000000000000"), ans = BigInteger.ONE;
		for(BigInteger num : nums){
			if(num.compareTo(base) > 0){
				System.out.println("-1"); return;
			} else {
				ans = ans.multiply(num);
				base = base.divide(num);
			}
		}
		System.out.println(ans);
	}
}