import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		long[] a=new long[n];
  		long ans=1;
		for(int c=0;c<n;c++){
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	}
  	if(ans!=0){
		for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	}
    }
    	System.out.println(ans);
    }
} import java.util.*; util.* java class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		long[] a=new long[n];
  		long ans=1;
		for(int c=0;c<n;c++){
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	}
  	if(ans!=0){
		for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	}
    }
    	System.out.println(ans);
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		long[] a=new long[n];
  		long ans=1;
		for(int c=0;c<n;c++){
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	}
  	if(ans!=0){
		for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	}
    }
    	System.out.println(ans);
    } main {
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		long[] a=new long[n];
  		long ans=1;
		for(int c=0;c<n;c++){
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	}
  	if(ans!=0){
		for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	}
    }
    	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[] a=new long[n]; a new long[n] n long ans=1; ans 1 for(int c=0;c<n;c++){
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	} int c=0; int c=0; c 0 c<n c n c++ c++ c {
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	} {
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	} a[c]=sc.nextLong() a[c] a c sc.nextLong() sc.nextLong sc if(a[c]==0){
            	ans=0;
            } a[c]==0 a[c] a c 0 {
            	ans=0;
            } ans=0 ans 0 if(ans!=0){
		for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	}
    } ans!=0 ans 0 {
		for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	}
    } for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	} int c=0; int c=0; c 0 c<n c n c++ c++ c {
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	} {
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	} if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          } a[c]<=(long)Math.pow(10,18)/ans a[c] a c (long)Math.pow(10,18)/ans (long)Math.pow(10,18) Math.pow Math 10 18 ans {
            ans*=a[c];
          } ans*=a[c] ans a[c] a c {
          	ans=-1;
            break;
          } ans=-1 ans -1 1 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*; 

class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
  		long[] a=new long[n];
  		long ans=1;
		for(int c=0;c<n;c++){
    		a[c]=sc.nextLong();
          	if(a[c]==0){
            	ans=0;
            }
    	}
  	if(ans!=0){
		for(int c=0;c<n;c++){
          if(a[c]<=(long)Math.pow(10,18)/ans){
            ans*=a[c];
          }else{
          	ans=-1;
            break;
          }
    	}
    }
    	System.out.println(ans);
    }
}
