import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        Multiplication2 solver = new Multiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class Multiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        }

        static long pow(long x, long n) {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        }

    }
}
 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.math.BigDecimal; BigDecimal java.math import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.ArrayList; ArrayList 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);
        Multiplication2 solver = new Multiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class Multiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        }

        static long pow(long x, long n) {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        }

    }
} 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);
        Multiplication2 solver = new Multiplication2();
        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);
        Multiplication2 solver = new Multiplication2();
        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) Multiplication2 solver = new Multiplication2(); solver new Multiplication2() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class Multiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        }

        static long pow(long x, long n) {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        }

    } Multiplication2 public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        } solve {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        } int num = in.nextInt(); num in.nextInt() in.nextInt in long ans = 1; ans 1 BigDecimal border = new BigDecimal(pow(10, 18)); border new BigDecimal(pow(10, 18)) List<Long> lists = new ArrayList<>(); lists new ArrayList<>() for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
                long a = in.nextLong();
                lists.add(a);
            } {
                long a = in.nextLong();
                lists.add(a);
            } long a = in.nextLong(); a in.nextLong() in.nextLong in lists.add(a) lists.add lists a if (lists.contains(0L)) {
                out.append("0\n");
                return;
            } lists.contains(0L) lists.contains lists 0L {
                out.append("0\n");
                return;
            } out.append("0\n") out.append out "0\n" return; for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            } Long a lists {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            } {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            } BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING); judge border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING) border.divide border new BigDecimal(a) 40 BigDecimal.ROUND_CEILING BigDecimal BigDecimal.ROUND_CEILING if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                } (new BigDecimal(ans)).compareTo(judge) > 0 (new BigDecimal(ans)).compareTo(judge) (new BigDecimal(ans)).compareTo (new BigDecimal(ans)) judge 0 {
                    out.append("-1\n");
                    return;
                } out.append("-1\n") out.append out "-1\n" return; ans *= a ans a out.append(String.valueOf(ans)) out.append out String.valueOf(ans) String.valueOf String ans int testNumber testNumber Scanner in in PrintWriter out out static long pow(long x, long n) {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        } pow {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        } if (n == 0) {
                return 1;
            } n == 0 n 0 {
                return 1;
            } return 1; 1 long result = pow(x, n / 2); result pow(x, n / 2) pow x n / 2 n 2 if (n % 2 == 0) {
                return (result * result);
            } n % 2 == 0 n % 2 n 2 0 {
                return (result * result);
            } return (result * result); (result * result) result result return ((result * result)) * x; ((result * result)) * x ((result * result)) result result x long x x long n n 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);
        Multiplication2 solver = new Multiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class Multiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        }

        static long pow(long x, long n) {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        }

    }
} 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);
        Multiplication2 solver = new Multiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class Multiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        }

        static long pow(long x, long n) {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.util.List;
import java.util.Scanner;
import java.util.ArrayList;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
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);
        Multiplication2 solver = new Multiplication2();
        solver.solve(1, in, out);
        out.close();
    }

    static class Multiplication2 {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int num = in.nextInt();
            long ans = 1;

            BigDecimal border = new BigDecimal(pow(10, 18));
            List<Long> lists = new ArrayList<>();

            for (int i = 0; i < num; i++) {
                long a = in.nextLong();
                lists.add(a);
            }

            if (lists.contains(0L)) {
                out.append("0\n");
                return;
            }

            for (Long a : lists) {
                BigDecimal judge = border.divide(new BigDecimal(a), 40, BigDecimal.ROUND_CEILING);
                if ((new BigDecimal(ans)).compareTo(judge) > 0) {
                    out.append("-1\n");
                    return;
                }
                ans *= a;
            }
            out.append(String.valueOf(ans));
        }

        static long pow(long x, long n) {

            if (n == 0) {
                return 1;
            }
            long result = pow(x, n / 2);

            if (n % 2 == 0) {
                return (result * result);
            }
            return ((result * result)) * x;
        }

    }
}

