import java.util.*; 
import java.lang.*; 


public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
                
                int N = scan.nextInt();
                ArrayList<Long> a = new ArrayList<>(); 
                for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                }
                long ans = 1;
                for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } 
                if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    }
                System.out.println(ans);
                
        }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
                
                int N = scan.nextInt();
                ArrayList<Long> a = new ArrayList<>(); 
                for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                }
                long ans = 1;
                for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } 
                if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    }
                System.out.println(ans);
                
        }
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
                
                int N = scan.nextInt();
                ArrayList<Long> a = new ArrayList<>(); 
                for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                }
                long ans = 1;
                for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } 
                if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    }
                System.out.println(ans);
                
        } main {
		Scanner scan = new Scanner(System.in);
                
                int N = scan.nextInt();
                ArrayList<Long> a = new ArrayList<>(); 
                for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                }
                long ans = 1;
                for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } 
                if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    }
                System.out.println(ans);
                
        } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan ArrayList<Long> a = new ArrayList<>(); a new ArrayList<>() for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                } int i=0; int i=0; i 0 i<N i N i++ i++ i {
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                } {
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                } long A1 = scan.nextLong(); A1 scan.nextLong() scan.nextLong scan if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    } A1==0 A1 0 {
                        System.out.println(0);
                        System.exit(0);
                    } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 a.add(A1) a.add a A1 long ans = 1; ans 1 for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } int i=0; int i=0; i 0 i<N i N i++ i++ i {
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } {
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } long q = (long)Math.pow(10,18)/(long)a.get(i); q (long)Math.pow(10,18)/(long)a.get(i) (long)Math.pow(10,18) Math.pow Math 10 18 (long)a.get(i) a.get a i if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    } ans<=q ans q {
                    ans = ans * a.get(i);
                    } ans = ans * a.get(i) ans ans * a.get(i) ans a.get(i) a.get a i {
                         System.out.println(-1);
                        System.exit(0);
                    } System.out.println(-1) System.out.println System.out System System.out -1 1 System.exit(0) System.exit System 0 if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    } (long)Math.pow(10,18)<ans (long)Math.pow(10,18) Math.pow Math 10 18 ans {
                        System.out.println(-1);
                        System.exit(0);
                    } System.out.println(-1) System.out.println System.out System System.out -1 1 System.exit(0) System.exit System 0 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 scan = new Scanner(System.in);
                
                int N = scan.nextInt();
                ArrayList<Long> a = new ArrayList<>(); 
                for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                }
                long ans = 1;
                for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } 
                if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    }
                System.out.println(ans);
                
        }
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
                
                int N = scan.nextInt();
                ArrayList<Long> a = new ArrayList<>(); 
                for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                }
                long ans = 1;
                for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } 
                if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    }
                System.out.println(ans);
                
        }
} Main
import java.util.*; 
import java.lang.*; 


public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
                
                int N = scan.nextInt();
                ArrayList<Long> a = new ArrayList<>(); 
                for(int i=0; i<N;i++){
                    long A1 = scan.nextLong();
                    if(A1==0){
                        System.out.println(0);
                        System.exit(0);
                    }
                    a.add(A1);
                }
                long ans = 1;
                for(int i=0; i<N;i++){
                    long q = (long)Math.pow(10,18)/(long)a.get(i);
                    if(ans<=q){
                    ans = ans * a.get(i);
                    }else{
                         System.out.println(-1);
                        System.exit(0);
                    }
                } 
                if((long)Math.pow(10,18)<ans){
                        System.out.println(-1);
                        System.exit(0);
                    }
                System.out.println(ans);
                
        }
}