import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
         
        int N = sc.nextInt();
      
      	long A = (long)(Math.pow(10, 18));
      
      	long[] B = new long[N];
      
      	boolean chk_0 = false;
      
      	for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        }
      
     	long C = 0L;
      	boolean chk = true;
        if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        }

      	if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        }

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
         
        int N = sc.nextInt();
      
      	long A = (long)(Math.pow(10, 18));
      
      	long[] B = new long[N];
      
      	boolean chk_0 = false;
      
      	for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        }
      
     	long C = 0L;
      	boolean chk = true;
        if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        }

      	if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        }

    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
         
        int N = sc.nextInt();
      
      	long A = (long)(Math.pow(10, 18));
      
      	long[] B = new long[N];
      
      	boolean chk_0 = false;
      
      	for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        }
      
     	long C = 0L;
      	boolean chk = true;
        if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        }

      	if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        }

    } main {
        
        Scanner sc = new Scanner(System.in);
         
        int N = sc.nextInt();
      
      	long A = (long)(Math.pow(10, 18));
      
      	long[] B = new long[N];
      
      	boolean chk_0 = false;
      
      	for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        }
      
     	long C = 0L;
      	boolean chk = true;
        if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        }

      	if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long A = (long)(Math.pow(10, 18)); A (long)(Math.pow(10, 18)) Math.pow Math 10 18 long[] B = new long[N]; B new long[N] N boolean chk_0 = false; chk_0 false for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        } {
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        } B[i] = sc.nextLong() B[i] B i sc.nextLong() sc.nextLong sc if ( B[i] == 0){
            chk_0 = true;
          } B[i] == 0 B[i] B i 0 {
            chk_0 = true;
          } chk_0 = true chk_0 true long C = 0L; C 0L boolean chk = true; chk true if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        } !chk_0 chk_0 {  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        } C = B[0] C B[0] B 0 for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            } int i = 1; int i = 1; i 1 i < B.length i B.length B B.length i++ i++ i {  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            } {  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            } try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                } ArithmeticException e {
                  chk = false;
                  break;
                } chk = false chk false break; {
                  C = Math.multiplyExact(C, B[i]);
                } C = Math.multiplyExact(C, B[i]) C Math.multiplyExact(C, B[i]) Math.multiplyExact Math C B[i] B i if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        } !chk || A < C !chk chk A < C A C {
			System.out.println(-1);
        } System.out.println(-1) System.out.println System.out System System.out -1 1 {
            System.out.println(C);
        } System.out.println(C) System.out.println System.out System System.out C String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
         
        int N = sc.nextInt();
      
      	long A = (long)(Math.pow(10, 18));
      
      	long[] B = new long[N];
      
      	boolean chk_0 = false;
      
      	for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        }
      
     	long C = 0L;
      	boolean chk = true;
        if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        }

      	if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        }

    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
         
        int N = sc.nextInt();
      
      	long A = (long)(Math.pow(10, 18));
      
      	long[] B = new long[N];
      
      	boolean chk_0 = false;
      
      	for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        }
      
     	long C = 0L;
      	boolean chk = true;
        if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        }

      	if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        }

    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
         
        int N = sc.nextInt();
      
      	long A = (long)(Math.pow(10, 18));
      
      	long[] B = new long[N];
      
      	boolean chk_0 = false;
      
      	for (int i = 0; i < N; i++){
          B[i] = sc.nextLong();
          if ( B[i] == 0){
            chk_0 = true;
          }
        }
      
     	long C = 0L;
      	boolean chk = true;
        if (!chk_0){  
          	C = B[0];
      		for (int i = 1; i < B.length; i++){  
          		try {
                  C = Math.multiplyExact(C, B[i]);
                } catch (ArithmeticException e) {
                  chk = false;
                  break;
                }
            }
        }

      	if (!chk || A < C){
			System.out.println(-1);
        } else {
            System.out.println(C);
        }

    }
}