
import java.util.Scanner;

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

} import java.util.Scanner; Scanner java.util public class Main {
	final static long limit = 1000000000000000000l;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long mul = 1l;
        boolean isOver = false;
        
        for(int i=0; i<N; i++) {
        	long a = sc.nextLong();
        	if(a==0) {
        		System.out.println(0);
        		return;
        	}
        	if (mul>limit/a) {
        		isOver = true;
        	}else {
            	mul *= a;
        	}
        }
        
        if(isOver) {
        	System.out.println(-1);
        }else {
        	System.out.println(mul);
        }
        
	}

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

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

} Main

import java.util.Scanner;

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

}
