import java.util.*;
import java.io.*;
 
public class Main{
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 1;
        long[] arr = new long[n];
        for(int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }

        boolean zero = false;
        for(int i = 0; i < n; i++){
            if(arr[i] == 0){
                zero = true;
            }
        }

        if(zero){
            sum = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(arr[i] <= (long) Math.pow(10, 18) / sum){
                    sum *= arr[i];
                } else{
                    sum = -1;
                    break;
                }
            }
        }
        System.out.println(sum);
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 1;
        long[] arr = new long[n];
        for(int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }

        boolean zero = false;
        for(int i = 0; i < n; i++){
            if(arr[i] == 0){
                zero = true;
            }
        }

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

        boolean zero = false;
        for(int i = 0; i < n; i++){
            if(arr[i] == 0){
                zero = true;
            }
        }

        if(zero){
            sum = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(arr[i] <= (long) Math.pow(10, 18) / sum){
                    sum *= arr[i];
                } else{
                    sum = -1;
                    break;
                }
            }
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 1;
        long[] arr = new long[n];
        for(int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }

        boolean zero = false;
        for(int i = 0; i < n; i++){
            if(arr[i] == 0){
                zero = true;
            }
        }

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

        boolean zero = false;
        for(int i = 0; i < n; i++){
            if(arr[i] == 0){
                zero = true;
            }
        }

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

        boolean zero = false;
        for(int i = 0; i < n; i++){
            if(arr[i] == 0){
                zero = true;
            }
        }

        if(zero){
            sum = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(arr[i] <= (long) Math.pow(10, 18) / sum){
                    sum *= arr[i];
                } else{
                    sum = -1;
                    break;
                }
            }
        }
        System.out.println(sum);
    }
} Main
import java.util.*;
import java.io.*;
 
public class Main{
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        long sum = 1;
        long[] arr = new long[n];
        for(int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }

        boolean zero = false;
        for(int i = 0; i < n; i++){
            if(arr[i] == 0){
                zero = true;
            }
        }

        if(zero){
            sum = 0;
        } else{
            for(int i = 0; i < n; i++){
                if(arr[i] <= (long) Math.pow(10, 18) / sum){
                    sum *= arr[i];
                } else{
                    sum = -1;
                    break;
                }
            }
        }
        System.out.println(sum);
    }
}