import java.util.*;
import java.lang.*;
import java.math.BigInteger;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.math.BigInteger; BigInteger java.math public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    }
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    } main {
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long n = sc.nextLong(); n sc.nextLong() sc.nextLong sc BigInteger count = BigInteger.ONE; count BigInteger.ONE BigInteger BigInteger.ONE long z = (long)Math.pow(10, 18); z (long)Math.pow(10, 18) Math.pow Math 10 18 BigInteger check = BigInteger.ONE; check BigInteger.ONE BigInteger BigInteger.ONE check = check.multiply(BigInteger.valueOf(z)) check check.multiply(BigInteger.valueOf(z)) check.multiply check BigInteger.valueOf(z) BigInteger.valueOf BigInteger z int i; i try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        } catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        } NoSuchElementException e {
            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 {
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        } for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	} i = 0; i = 0 i 0 i < n i n i++ i++ i {
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	} {
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	} count = count.multiply(BigInteger.valueOf(sc.nextLong())) count count.multiply(BigInteger.valueOf(sc.nextLong())) count.multiply count BigInteger.valueOf(sc.nextLong()) BigInteger.valueOf BigInteger sc.nextLong() sc.nextLong sc if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 } count.compareTo(check) > 0 count.compareTo(check) count.compareTo count check 0 {
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 } for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    } i = 0; i = 0 i 0 i <= n i n i++ i++ i {
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    } {
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    } if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      } sc.nextLong() == 0 sc.nextLong() sc.nextLong sc 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 System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    }
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    }
} Main
import java.util.*;
import java.lang.*;
import java.math.BigInteger;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long n = sc.nextLong();
        BigInteger count = BigInteger.ONE;
      	long z = (long)Math.pow(10, 18);
      	BigInteger check = BigInteger.ONE;
      	check = check.multiply(BigInteger.valueOf(z));
        int i;
      	
        try{
      		for(i = 0;i < n; i++){
              count = count.multiply(BigInteger.valueOf(sc.nextLong()));
              	//10の18乗を超えた時
            	if(count.compareTo(check) > 0){
                  	//強引にキャッチさせる構文にする
                  	for(i = 0;i <= n ; i++){
                      if(sc.nextLong() == 0){
                        System.out.println(0);
              		    System.exit(0);                        
                      }
                    }
       			 }
        	}
        }catch (NoSuchElementException e){
            System.out.println(-1);
          	System.exit(0);
        }

      	 System.out.println(count);
    }
}