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