import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class BMultiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        }

    }
}
 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class BMultiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out Scanner in = new Scanner(inputStream); in new Scanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) BMultiplication2 solver = new BMultiplication2(); solver new BMultiplication2() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class BMultiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        }

    } BMultiplication2 public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        } solve {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in long[] num = new long[n]; num new long[n] n for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                num[i] = in.nextLong();
            } {
                num[i] = in.nextLong();
            } num[i] = in.nextLong() num[i] num i in.nextLong() in.nextLong in Arrays.sort(num) Arrays.sort Arrays num if (num[0] == 0) {
                out.println(0);
                return;
            } num[0] == 0 num[0] num 0 0 {
                out.println(0);
                return;
            } out.println(0) out.println out 0 return; long ans = 1; ans 1 for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            } {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            } if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                } 1000000000000000000L / ans < num[i] 1000000000000000000L / ans 1000000000000000000L ans num[i] num i {
                    out.println(-1);
                    return;
                } out.println(-1) out.println out -1 1 return; ans *= num[i] ans num[i] num i if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                } ans > 1000000000000000000L || ans < 0 ans > 1000000000000000000L ans 1000000000000000000L ans < 0 ans 0 {
                    out.println(-1);
                    return;
                } out.println(-1) out.println out -1 1 return; out.println(ans) out.println out ans int testNumber testNumber Scanner in in PrintWriter out out public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class BMultiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class BMultiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BMultiplication2 solver = new BMultiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class BMultiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            long[] num = new long[n];
            for (int i = 0; i < n; i++) {
                num[i] = in.nextLong();
            }
            Arrays.sort(num);
            if (num[0] == 0) {
                out.println(0);
                return;
            }

            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (1000000000000000000L / ans < num[i]) {
                    out.println(-1);
                    return;
                }
                ans *= num[i];
                if (ans > 1000000000000000000L || ans < 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(ans);
        }

    }
}

