import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

        int a = scan.nextInt();
        long result = 1;
        long[] c = new long[a];
        long b = (long) Math.pow(10,18);

        for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        }

        Arrays.sort(c);
        if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        }

            for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            }

            System.out.println(result);
            scan.close();

    }

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

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

        int a = scan.nextInt();
        long result = 1;
        long[] c = new long[a];
        long b = (long) Math.pow(10,18);

        for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        }

        Arrays.sort(c);
        if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        }

            for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            }

            System.out.println(result);
            scan.close();

    }

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

        int a = scan.nextInt();
        long result = 1;
        long[] c = new long[a];
        long b = (long) Math.pow(10,18);

        for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        }

        Arrays.sort(c);
        if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        }

            for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            }

            System.out.println(result);
            scan.close();

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

        int a = scan.nextInt();
        long result = 1;
        long[] c = new long[a];
        long b = (long) Math.pow(10,18);

        for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        }

        Arrays.sort(c);
        if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        }

            for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            }

            System.out.println(result);
            scan.close();

    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan long result = 1; result 1 long[] c = new long[a]; c new long[a] a long b = (long) Math.pow(10,18); b (long) Math.pow(10,18) Math.pow Math 10 18 for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        } int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
            c[i] = scan.nextLong();

        } {
            c[i] = scan.nextLong();

        } c[i] = scan.nextLong() c[i] c i scan.nextLong() scan.nextLong scan Arrays.sort(c) Arrays.sort Arrays c if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        } c[0] == 0 c[0] c 0 0 {
            System.out.println(0);
            scan.close();
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 scan.close() scan.close scan return; for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            } int j = 0; int j = 0; j 0 j < a j a j++ j++ j {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            } {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            } if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                } result > b/c[j] result b/c[j] b c[j] c j {
                    System.out.println(-1);
                    scan.close();
                    return;
                } System.out.println(-1) System.out.println System.out System System.out -1 1 scan.close() scan.close scan return; result *= c[j] result c[j] c j System.out.println(result) System.out.println System.out System System.out result scan.close() scan.close scan String[] args args public class Main {

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

        int a = scan.nextInt();
        long result = 1;
        long[] c = new long[a];
        long b = (long) Math.pow(10,18);

        for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        }

        Arrays.sort(c);
        if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        }

            for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            }

            System.out.println(result);
            scan.close();

    }

} public class Main {

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

        int a = scan.nextInt();
        long result = 1;
        long[] c = new long[a];
        long b = (long) Math.pow(10,18);

        for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        }

        Arrays.sort(c);
        if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        }

            for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            }

            System.out.println(result);
            scan.close();

    }

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

        int a = scan.nextInt();
        long result = 1;
        long[] c = new long[a];
        long b = (long) Math.pow(10,18);

        for (int i = 0; i < a; i++) {
            c[i] = scan.nextLong();

        }

        Arrays.sort(c);
        if (c[0] == 0) {
            System.out.println(0);
            scan.close();
            return;
        }

            for (int j = 0; j < a; j++) {
                if (result > b/c[j]) {
                    System.out.println(-1);
                    scan.close();
                    return;
                }
                result *= c[j];
            }

            System.out.println(result);
            scan.close();

    }

}