import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	long N = (long)Math.pow(10,18);
      	long[] num = new long[n];
      	long ans = 1;
      	boolean overF = false;
      	boolean zeroF = false;
		for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        }
      if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      }
      if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      }         
       System.out.println(ans); 
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	long N = (long)Math.pow(10,18);
      	long[] num = new long[n];
      	long ans = 1;
      	boolean overF = false;
      	boolean zeroF = false;
		for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        }
      if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      }
      if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      }         
       System.out.println(ans); 
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	long N = (long)Math.pow(10,18);
      	long[] num = new long[n];
      	long ans = 1;
      	boolean overF = false;
      	boolean zeroF = false;
		for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        }
      if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      }
      if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      }         
       System.out.println(ans); 
	} main {
		Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	long N = (long)Math.pow(10,18);
      	long[] num = new long[n];
      	long ans = 1;
      	boolean overF = false;
      	boolean zeroF = false;
		for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        }
      if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      }
      if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      }         
       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 N = (long)Math.pow(10,18); N (long)Math.pow(10,18) Math.pow Math 10 18 long[] num = new long[n]; num new long[n] n long ans = 1; ans 1 boolean overF = false; overF false boolean zeroF = false; zeroF false for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        } {
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        } num[i] = sc.nextLong() num[i] num i sc.nextLong() sc.nextLong sc if( num[i] == 0 ){
              zeroF = true;
              break;
            } num[i] == 0 num[i] num i 0 {
              zeroF = true;
              break;
            } zeroF = true zeroF true break; if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      } !zeroF zeroF {
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      } for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        } {
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        } if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            } ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) ) ans * num[i] > N ans * num[i] ans num[i] num i N ( ( ans>100000000)&&(num[i]>1000000000) ) ( ans>100000000) ans 100000000 (num[i]>1000000000) num[i] num i 1000000000 {
              overF = true;
              break;
            } overF = true overF true break; ans *= num[i] ans num[i] num i if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      } zeroF {
        ans = 0;
      } ans = 0 ans 0 if( overF ){
        ans = -1;
      }else{
      
      } overF {
        ans = -1;
      } ans = -1 ans -1 1 {
      
      } 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 sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	long N = (long)Math.pow(10,18);
      	long[] num = new long[n];
      	long ans = 1;
      	boolean overF = false;
      	boolean zeroF = false;
		for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        }
      if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      }
      if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      }         
       System.out.println(ans); 
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	long N = (long)Math.pow(10,18);
      	long[] num = new long[n];
      	long ans = 1;
      	boolean overF = false;
      	boolean zeroF = false;
		for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        }
      if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      }
      if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      }         
       System.out.println(ans); 
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	long N = (long)Math.pow(10,18);
      	long[] num = new long[n];
      	long ans = 1;
      	boolean overF = false;
      	boolean zeroF = false;
		for(int i=0;i<n;i++){
			num[i] = sc.nextLong();
          	if( num[i] == 0 ){
              zeroF = true;
              break;
            }
        }
      if( !zeroF ){
     	for(int i=0;i<n;i++){
          	if( ans * num[i] > N || ( ( ans>100000000)&&(num[i]>1000000000) )  ){
              overF = true;
              break;
            }
          ans *= num[i];
        }
      }
      if( zeroF ){
        ans = 0;
      }else if( overF ){
        ans = -1;
      }else{
      
      }         
       System.out.println(ans); 
	}
}