import java.text.NumberFormat;
import java.util.Scanner;

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

        int n = sc.nextInt();

        long numbers[] = new long[n];

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

        double ans = 0;
        for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        }

        if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        }

//        long ans = 1;
//        for(int i = 0;i < n;i++){
//            ans *= numbers[i];
//
//            if(ans > (long)1e18){
//                System.out.println(-1);
//                return;
//            }
//        }
//
//        System.out.println(ans);



//        NumberFormat nm = NumberFormat.getNumberInstance();
//        System.out.println(nm.format(l));


    }
} import java.text.NumberFormat; NumberFormat java.text 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();

        long numbers[] = new long[n];

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

        double ans = 0;
        for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        }

        if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        }

//        long ans = 1;
//        for(int i = 0;i < n;i++){
//            ans *= numbers[i];
//
//            if(ans > (long)1e18){
//                System.out.println(-1);
//                return;
//            }
//        }
//
//        System.out.println(ans);



//        NumberFormat nm = NumberFormat.getNumberInstance();
//        System.out.println(nm.format(l));


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

        int n = sc.nextInt();

        long numbers[] = new long[n];

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

        double ans = 0;
        for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        }

        if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        }

//        long ans = 1;
//        for(int i = 0;i < n;i++){
//            ans *= numbers[i];
//
//            if(ans > (long)1e18){
//                System.out.println(-1);
//                return;
//            }
//        }
//
//        System.out.println(ans);



//        NumberFormat nm = NumberFormat.getNumberInstance();
//        System.out.println(nm.format(l));


    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        long numbers[] = new long[n];

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

        double ans = 0;
        for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        }

        if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        }

//        long ans = 1;
//        for(int i = 0;i < n;i++){
//            ans *= numbers[i];
//
//            if(ans > (long)1e18){
//                System.out.println(-1);
//                return;
//            }
//        }
//
//        System.out.println(ans);



//        NumberFormat nm = NumberFormat.getNumberInstance();
//        System.out.println(nm.format(l));


    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long numbers[] = new long[n]; numbers new long[n] n for(int i = 0; i < n; i++) {
            numbers[i] = sc.nextLong();
            if(numbers[i] == 0){
                System.out.println(0);
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            numbers[i] = sc.nextLong();
            if(numbers[i] == 0){
                System.out.println(0);
                return;
            }
        } {
            numbers[i] = sc.nextLong();
            if(numbers[i] == 0){
                System.out.println(0);
                return;
            }
        } numbers[i] = sc.nextLong() numbers[i] numbers i sc.nextLong() sc.nextLong sc if(numbers[i] == 0){
                System.out.println(0);
                return;
            } numbers[i] == 0 numbers[i] numbers i 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; double ans = 0; ans 0 for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            double d = Math.log10(numbers[i]);
            ans += d;
        } {
            double d = Math.log10(numbers[i]);
            ans += d;
        } double d = Math.log10(numbers[i]); d Math.log10(numbers[i]) Math.log10 Math numbers[i] numbers i ans += d ans d if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        } ans > 18 ans 18 {
            System.out.println(-1);
            return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        } long answer = 1; answer 1 for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            } {
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            } answer *= numbers[i] answer numbers[i] numbers i if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                } answer > (long)1e18 answer (long)1e18 {
                    System.out.println(-1);
                    return;
                } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(answer) System.out.println System.out System System.out answer String args[] args public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        long numbers[] = new long[n];

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

        double ans = 0;
        for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        }

        if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        }

//        long ans = 1;
//        for(int i = 0;i < n;i++){
//            ans *= numbers[i];
//
//            if(ans > (long)1e18){
//                System.out.println(-1);
//                return;
//            }
//        }
//
//        System.out.println(ans);



//        NumberFormat nm = NumberFormat.getNumberInstance();
//        System.out.println(nm.format(l));


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

        int n = sc.nextInt();

        long numbers[] = new long[n];

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

        double ans = 0;
        for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        }

        if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        }

//        long ans = 1;
//        for(int i = 0;i < n;i++){
//            ans *= numbers[i];
//
//            if(ans > (long)1e18){
//                System.out.println(-1);
//                return;
//            }
//        }
//
//        System.out.println(ans);



//        NumberFormat nm = NumberFormat.getNumberInstance();
//        System.out.println(nm.format(l));


    }
} Main
import java.text.NumberFormat;
import java.util.Scanner;

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

        int n = sc.nextInt();

        long numbers[] = new long[n];

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

        double ans = 0;
        for(int i = 0; i < n;i++){
            double d = Math.log10(numbers[i]);
            ans += d;
        }

        if(ans > 18){
            System.out.println(-1);
            return;
        }else{
            long answer = 1;
            for(int i = 0;i < n;i++){
                answer *= numbers[i];

                if(answer > (long)1e18){
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(answer);

        }

//        long ans = 1;
//        for(int i = 0;i < n;i++){
//            ans *= numbers[i];
//
//            if(ans > (long)1e18){
//                System.out.println(-1);
//                return;
//            }
//        }
//
//        System.out.println(ans);



//        NumberFormat nm = NumberFormat.getNumberInstance();
//        System.out.println(nm.format(l));


    }
}
