import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();

        
        BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));

        long[] a = new long[n];
        BigInteger mul = BigInteger.ONE;
        BigInteger tmp = null;
        for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        }

        for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        }

        System.out.println(mul.toString());
    }
}
 import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();

        
        BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));

        long[] a = new long[n];
        BigInteger mul = BigInteger.ONE;
        BigInteger tmp = null;
        for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        }

        for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        }

        System.out.println(mul.toString());
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();

        
        BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));

        long[] a = new long[n];
        BigInteger mul = BigInteger.ONE;
        BigInteger tmp = null;
        for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        }

        for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        }

        System.out.println(mul.toString());
    } main {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();

        
        BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));

        long[] a = new long[n];
        BigInteger mul = BigInteger.ONE;
        BigInteger tmp = null;
        for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        }

        for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        }

        System.out.println(mul.toString());
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18)); dMax BigInteger.valueOf((long)Math.pow(10, 18)) BigInteger.valueOf BigInteger (long)Math.pow(10, 18) Math.pow Math 10 18 long[] a = new long[n]; a new long[n] n BigInteger mul = BigInteger.ONE; mul BigInteger.ONE BigInteger BigInteger.ONE BigInteger tmp = null; tmp null for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        } {
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if (a[i] == 0) {
                System.out.println("0");
                return ;
            } a[i] == 0 a[i] a i 0 {
                System.out.println("0");
                return ;
            } System.out.println("0") System.out.println System.out System System.out "0" return ; for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        } {

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        } tmp = BigInteger.valueOf(a[i]) tmp BigInteger.valueOf(a[i]) BigInteger.valueOf BigInteger a[i] a i if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            } mul.multiply(tmp).compareTo(dMax) > 0 mul.multiply(tmp).compareTo(dMax) mul.multiply(tmp).compareTo mul.multiply(tmp) mul.multiply mul tmp dMax 0 {
                System.out.println("-1");
                return ;
            } System.out.println("-1") System.out.println System.out System System.out "-1" return ; {
                mul = mul.multiply(tmp);
            } mul = mul.multiply(tmp) mul mul.multiply(tmp) mul.multiply mul tmp System.out.println(mul.toString()) System.out.println System.out System System.out mul.toString() mul.toString mul String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();

        
        BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));

        long[] a = new long[n];
        BigInteger mul = BigInteger.ONE;
        BigInteger tmp = null;
        for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        }

        for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        }

        System.out.println(mul.toString());
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();

        
        BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));

        long[] a = new long[n];
        BigInteger mul = BigInteger.ONE;
        BigInteger tmp = null;
        for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        }

        for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        }

        System.out.println(mul.toString());
    }
} Main
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        int n = sc.nextInt();

        
        BigInteger dMax = BigInteger.valueOf((long)Math.pow(10, 18));

        long[] a = new long[n];
        BigInteger mul = BigInteger.ONE;
        BigInteger tmp = null;
        for(int i=0;i<n;i++){
            a[i] = sc.nextLong();

            if (a[i] == 0) {
                System.out.println("0");
                return ;
            }
        }

        for(int i=0;i<n;i++){

            tmp = BigInteger.valueOf(a[i]);
            if (mul.multiply(tmp).compareTo(dMax) > 0 ) {
                System.out.println("-1");
                return ;
            } else {
                mul = mul.multiply(tmp);
            }
        }

        System.out.println(mul.toString());
    }
}

