import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
      	int factorAmount = scanner.nextInt();
      	long[] factors = new long[factorAmount];
      	for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	}
      	
      		System.out.print(Calculate(factors));
	}
	
	private static BigInteger Calculate(long[] numbers) {
		for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO;
      	
      	BigInteger result = BigInteger.ONE;
      	BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18));
      	for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	}
      	
		return result;
	}
} import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
      	int factorAmount = scanner.nextInt();
      	long[] factors = new long[factorAmount];
      	for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	}
      	
      		System.out.print(Calculate(factors));
	}
	
	private static BigInteger Calculate(long[] numbers) {
		for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO;
      	
      	BigInteger result = BigInteger.ONE;
      	BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18));
      	for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	}
      	
		return result;
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
      	int factorAmount = scanner.nextInt();
      	long[] factors = new long[factorAmount];
      	for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	}
      	
      		System.out.print(Calculate(factors));
	} main {
		Scanner scanner = new Scanner(System.in);
      	int factorAmount = scanner.nextInt();
      	long[] factors = new long[factorAmount];
      	for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	}
      	
      		System.out.print(Calculate(factors));
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int factorAmount = scanner.nextInt(); factorAmount scanner.nextInt() scanner.nextInt scanner long[] factors = new long[factorAmount]; factors new long[factorAmount] factorAmount for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	} int i = 0; int i = 0; i 0 i < factorAmount i factorAmount i++ i++ i {
      		factors[i] = scanner.nextLong(); 
      	} {
      		factors[i] = scanner.nextLong(); 
      	} factors[i] = scanner.nextLong() factors[i] factors i scanner.nextLong() scanner.nextLong scanner System.out.print(Calculate(factors)) System.out.print System.out System System.out Calculate(factors) Calculate factors String[] args args private static BigInteger Calculate(long[] numbers) {
		for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO;
      	
      	BigInteger result = BigInteger.ONE;
      	BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18));
      	for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	}
      	
		return result;
	} Calculate {
		for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO;
      	
      	BigInteger result = BigInteger.ONE;
      	BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18));
      	for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	}
      	
		return result;
	} for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO; int i = 0; int i = 0; i 0 i < numbers.length i numbers.length numbers numbers.length i++ i++ i if(numbers[i] == 0l)
      			return  BigInteger.ZERO; if(numbers[i] == 0l)
      			return  BigInteger.ZERO; numbers[i] == 0l numbers[i] numbers i 0l return  BigInteger.ZERO; BigInteger.ZERO BigInteger BigInteger.ZERO BigInteger result = BigInteger.ONE; result BigInteger.ONE BigInteger BigInteger.ONE BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18)); limit BigInteger.valueOf((long)Math.pow(10, 18)) BigInteger.valueOf BigInteger (long)Math.pow(10, 18) Math.pow Math 10 18 for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	} int i = 0; int i = 0; i 0 i < numbers.length i numbers.length numbers numbers.length i++ i++ i {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	} {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	} result = result.multiply(BigInteger.valueOf(numbers[i])) result result.multiply(BigInteger.valueOf(numbers[i])) result.multiply result BigInteger.valueOf(numbers[i]) BigInteger.valueOf BigInteger numbers[i] numbers i if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); result.min(limit) == limit && !result.equals(limit) result.min(limit) == limit result.min(limit) result.min result limit limit !result.equals(limit) result.equals(limit) result.equals result limit return BigInteger.valueOf(-1); BigInteger.valueOf(-1) BigInteger.valueOf BigInteger -1 1 return result; result long[] numbers numbers public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
      	int factorAmount = scanner.nextInt();
      	long[] factors = new long[factorAmount];
      	for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	}
      	
      		System.out.print(Calculate(factors));
	}
	
	private static BigInteger Calculate(long[] numbers) {
		for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO;
      	
      	BigInteger result = BigInteger.ONE;
      	BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18));
      	for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	}
      	
		return result;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
      	int factorAmount = scanner.nextInt();
      	long[] factors = new long[factorAmount];
      	for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	}
      	
      		System.out.print(Calculate(factors));
	}
	
	private static BigInteger Calculate(long[] numbers) {
		for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO;
      	
      	BigInteger result = BigInteger.ONE;
      	BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18));
      	for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	}
      	
		return result;
	}
} Main
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
      	int factorAmount = scanner.nextInt();
      	long[] factors = new long[factorAmount];
      	for(int i = 0; i < factorAmount; i++) {
      		factors[i] = scanner.nextLong(); 
      	}
      	
      		System.out.print(Calculate(factors));
	}
	
	private static BigInteger Calculate(long[] numbers) {
		for(int i = 0; i < numbers.length; i++) 
      		if(numbers[i] == 0l)
      			return  BigInteger.ZERO;
      	
      	BigInteger result = BigInteger.ONE;
      	BigInteger limit = BigInteger.valueOf((long)Math.pow(10, 18));
      	for(int i = 0; i < numbers.length; i++) {
      		result = result.multiply(BigInteger.valueOf(numbers[i]));
     		if (result.min(limit) == limit && !result.equals(limit))
      		    return BigInteger.valueOf(-1); 
     		
      	}
      	
		return result;
	}
}
