	import java.util.*;
	import java.util.Map.Entry;
	 
	 
	 class Main {
		 static int mod =  (int) (Math.pow(10,9)+7);
//		 static int mod =  (int) 998244353;
		 public static void main(String[] args) {
	    	
	        Scanner sc = new Scanner(System.in);

	        int N = sc.nextInt();
	        long ans=1;
	        long[] a = new long[N];
	        for (int i=0 ; i<N; i++) {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        }
	        if(ans>(long)Math.pow(10, 18))ans=-1;
    		System.out.println(ans);
	    }
	} import java.util.*; util.* java import java.util.Map.Entry; Entry java.util.Map class Main {
		 static int mod =  (int) (Math.pow(10,9)+7);
//		 static int mod =  (int) 998244353;
		 public static void main(String[] args) {
	    	
	        Scanner sc = new Scanner(System.in);

	        int N = sc.nextInt();
	        long ans=1;
	        long[] a = new long[N];
	        for (int i=0 ; i<N; i++) {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        }
	        if(ans>(long)Math.pow(10, 18))ans=-1;
    		System.out.println(ans);
	    }
	} Main static int mod =  (int) (Math.pow(10,9)+7); mod (int) (Math.pow(10,9)+7) Math.pow(10,9) Math.pow Math 10 9 7 //		 static int mod =  (int) 998244353;
		 public static void main(String[] args) {
	    	
	        Scanner sc = new Scanner(System.in);

	        int N = sc.nextInt();
	        long ans=1;
	        long[] a = new long[N];
	        for (int i=0 ; i<N; i++) {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        }
	        if(ans>(long)Math.pow(10, 18))ans=-1;
    		System.out.println(ans);
	    } main {
	    	
	        Scanner sc = new Scanner(System.in);

	        int N = sc.nextInt();
	        long ans=1;
	        long[] a = new long[N];
	        for (int i=0 ; i<N; i++) {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        }
	        if(ans>(long)Math.pow(10, 18))ans=-1;
    		System.out.println(ans);
	    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long ans=1; ans 1 long[] a = new long[N]; a new long[N] N for (int i=0 ; i<N; i++) {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        } int i=0 ; int i=0 ; i 0 i<N i N i++ i++ i {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        } {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        } a[i] = Long.parseLong(sc.next()) a[i] a i Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            } (long)(Math.pow(10, 18)/ans)<a[i] (long)(Math.pow(10, 18)/ans) Math.pow(10, 18) Math.pow Math 10 18 ans a[i] a i {
	            	ans=-1;
	            } ans=-1 ans -1 1 if(ans!=-1){
	            	ans=ans*a[i];
	            } ans!=-1 ans -1 1 {
	            	ans=ans*a[i];
	            } ans=ans*a[i] ans ans*a[i] ans a[i] a i if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            } a[i]==0 a[i] a i 0 {
	            	System.out.println(0);
	            	return;
	            } System.out.println(0) System.out.println System.out System System.out 0 return; if(ans>(long)Math.pow(10, 18))ans=-1; ans>(long)Math.pow(10, 18) ans (long)Math.pow(10, 18) Math.pow Math 10 18 ans=-1 ans -1 1 System.out.println(ans) System.out.println System.out System System.out ans String[] args args
	import java.util.*;
	import java.util.Map.Entry;
	 
	 
	 class Main {
		 static int mod =  (int) (Math.pow(10,9)+7);
//		 static int mod =  (int) 998244353;
		 public static void main(String[] args) {
	    	
	        Scanner sc = new Scanner(System.in);

	        int N = sc.nextInt();
	        long ans=1;
	        long[] a = new long[N];
	        for (int i=0 ; i<N; i++) {
	            a[i] = Long.parseLong(sc.next());
	            if((long)(Math.pow(10, 18)/ans)<a[i]) {
	            	ans=-1;
	            } else if(ans!=-1){
	            	ans=ans*a[i];
	            }
	            if(a[i]==0) {
	            	System.out.println(0);
	            	return;
	            }
	        }
	        if(ans>(long)Math.pow(10, 18))ans=-1;
    		System.out.println(ans);
	    }
	}
