import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		long[] number = new long[a];
		for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		}
		long result = 0;
		result = number[0];
		boolean flag = true;
		for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		}
		
		if(flag == true) {
			System.out.println(result);
		}
		
		
			
		

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		long[] number = new long[a];
		for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		}
		long result = 0;
		result = number[0];
		boolean flag = true;
		for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		}
		
		if(flag == true) {
			System.out.println(result);
		}
		
		
			
		

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		long[] number = new long[a];
		for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		}
		long result = 0;
		result = number[0];
		boolean flag = true;
		for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		}
		
		if(flag == true) {
			System.out.println(result);
		}
		
		
			
		

	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		long[] number = new long[a];
		for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		}
		long result = 0;
		result = number[0];
		boolean flag = true;
		for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		}
		
		if(flag == true) {
			System.out.println(result);
		}
		
		
			
		

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc long[] number = new long[a]; number new long[a] a for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		} int i=0; int i=0; i 0 i<a i a i++ i++ i {
			number[i] = sc.nextLong();
		} {
			number[i] = sc.nextLong();
		} number[i] = sc.nextLong() number[i] number i sc.nextLong() sc.nextLong sc long result = 0; result 0 result = number[0] result number[0] number 0 boolean flag = true; flag true for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		} int i=0; int i=0; i 0 i<a i a i++ i++ i {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		} {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		} if(number[i] == 0) {
				System.out.println(0);
				return;
			} number[i] == 0 number[i] number i 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		} int i=1; int i=1; i 1 i<a i a i++ i++ i {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		} {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		} if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			} number[i] > 1000000000000000000l / result number[i] number i 1000000000000000000l / result 1000000000000000000l result {
				System.out.println(-1);
				flag = false;
				break;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 flag = false flag false break; {
				result = result*number[i];
			} result = result*number[i] result result*number[i] result number[i] number i if(flag == true) {
			System.out.println(result);
		} flag == true flag true {
			System.out.println(result);
		} System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		long[] number = new long[a];
		for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		}
		long result = 0;
		result = number[0];
		boolean flag = true;
		for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		}
		
		if(flag == true) {
			System.out.println(result);
		}
		
		
			
		

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		long[] number = new long[a];
		for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		}
		long result = 0;
		result = number[0];
		boolean flag = true;
		for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		}
		
		if(flag == true) {
			System.out.println(result);
		}
		
		
			
		

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		
		long[] number = new long[a];
		for(int i=0;i<a;i++) {
			number[i] = sc.nextLong();
		}
		long result = 0;
		result = number[0];
		boolean flag = true;
		for(int i=0;i<a;i++) {
			if(number[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		for(int i=1;i<a;i++) {
			
			if(number[i] > 1000000000000000000l / result) {
				System.out.println(-1);
				flag = false;
				break;
			}else {
				result = result*number[i];
			}
			
		}
		
		if(flag == true) {
			System.out.println(result);
		}
		
		
			
		

	}

}
