import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

  		int n = sc.nextInt();
      	long nums[] = new long[n];
      	long ans = 1;
      	boolean con = true;
      	long zero = 0; 
      	long limit = 1000000000;
      	limit *= 1000000000;
      	for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        }
      
      	if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        }
           
      	for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        }
      
      	if(con) System.out.println(ans);
      	else System.out.println("-1");
        
	}
} 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 nums[] = new long[n];
      	long ans = 1;
      	boolean con = true;
      	long zero = 0; 
      	long limit = 1000000000;
      	limit *= 1000000000;
      	for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        }
      
      	if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        }
           
      	for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        }
      
      	if(con) System.out.println(ans);
      	else System.out.println("-1");
        
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

  		int n = sc.nextInt();
      	long nums[] = new long[n];
      	long ans = 1;
      	boolean con = true;
      	long zero = 0; 
      	long limit = 1000000000;
      	limit *= 1000000000;
      	for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        }
      
      	if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        }
           
      	for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        }
      
      	if(con) System.out.println(ans);
      	else System.out.println("-1");
        
	} main {
		Scanner sc = new Scanner(System.in);

  		int n = sc.nextInt();
      	long nums[] = new long[n];
      	long ans = 1;
      	boolean con = true;
      	long zero = 0; 
      	long limit = 1000000000;
      	limit *= 1000000000;
      	for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        }
      
      	if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        }
           
      	for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        }
      
      	if(con) System.out.println(ans);
      	else System.out.println("-1");
        
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long nums[] = new long[n]; nums new long[n] n long ans = 1; ans 1 boolean con = true; con true long zero = 0; zero 0 long limit = 1000000000; limit 1000000000 limit *= 1000000000 limit 1000000000 for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        } {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        } nums[i] = sc.nextLong() nums[i] nums i sc.nextLong() sc.nextLong sc if(nums[i] == 0) ans = 0; nums[i] == 0 nums[i] nums i 0 ans = 0 ans 0 if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        } ans != 0 ans 0 {
          ans = nums[0];
          limit /= nums[0];
        } ans = nums[0] ans nums[0] nums 0 limit /= nums[0] limit nums[0] nums 0 for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        } int i = 1; int i = 1; i 1 i < n && ans != 0 i < n i n ans != 0 ans 0 i++ i++ i {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        } {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        } if(nums[i] > limit) con = false; nums[i] > limit nums[i] nums i limit con = false con false if(con){
              ans *= nums[i];
              limit /= nums[i];
            } con {
              ans *= nums[i];
              limit /= nums[i];
            } ans *= nums[i] ans nums[i] nums i limit /= nums[i] limit nums[i] nums i if(con) System.out.println(ans);
      	else System.out.println("-1"); con System.out.println(ans) System.out.println System.out System System.out ans System.out.println("-1") System.out.println System.out System System.out "-1" String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

  		int n = sc.nextInt();
      	long nums[] = new long[n];
      	long ans = 1;
      	boolean con = true;
      	long zero = 0; 
      	long limit = 1000000000;
      	limit *= 1000000000;
      	for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        }
      
      	if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        }
           
      	for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        }
      
      	if(con) System.out.println(ans);
      	else System.out.println("-1");
        
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

  		int n = sc.nextInt();
      	long nums[] = new long[n];
      	long ans = 1;
      	boolean con = true;
      	long zero = 0; 
      	long limit = 1000000000;
      	limit *= 1000000000;
      	for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        }
      
      	if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        }
           
      	for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        }
      
      	if(con) System.out.println(ans);
      	else System.out.println("-1");
        
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

  		int n = sc.nextInt();
      	long nums[] = new long[n];
      	long ans = 1;
      	boolean con = true;
      	long zero = 0; 
      	long limit = 1000000000;
      	limit *= 1000000000;
      	for(int i = 0;i < n; i++) {
          nums[i] = sc.nextLong();
          if(nums[i] == 0) ans = 0; 
        }
      
      	if(ans != 0) {
          ans = nums[0];
          limit /= nums[0];
        }
           
      	for(int i = 1;i < n && ans != 0; i++) {
          	if(nums[i] > limit) con = false;
          	if(con){
              ans *= nums[i];
              limit /= nums[i];
            }
        }
      
      	if(con) System.out.println(ans);
      	else System.out.println("-1");
        
	}
}
