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

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

    static class abc169_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        }

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

    static class abc169_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        }

    }
} 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);
        abc169_b solver = new abc169_b();
        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);
        abc169_b solver = new abc169_b();
        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) abc169_b solver = new abc169_b(); solver new abc169_b() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class abc169_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        }

    } abc169_b public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        } solve {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        } int N = in.nextInt(); N in.nextInt() in.nextInt in long a[] = new long[N]; a new long[N] N for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            } {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            } long by = in.nextLong(); by in.nextLong() in.nextLong in if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                } by == 0 by 0 {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } if (by == 0) {
                        out.println(0);
                        return;
                    } by == 0 by 0 {
                        out.println(0);
                        return;
                    } out.println(0) out.println out 0 return; {
                    a[i] = by;
                } a[i] = by a[i] a i by long wkval = 1; wkval 1 for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            } {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            } if (a[i] == 1) {
                    continue;
                } a[i] == 1 a[i] a i 1 {
                    continue;
                } continue; if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                } a[i] <= (1000000000000000000l / wkval) a[i] a i (1000000000000000000l / wkval) 1000000000000000000l wkval {
                    wkval *= a[i];
                } wkval *= a[i] wkval a[i] a i {
                    out.println(-1);
                    return;
                } out.println(-1) out.println out -1 1 return; out.println(wkval) out.println out wkval 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);
        abc169_b solver = new abc169_b();
        solver.solve(1, in, out);
        out.close();
    }

    static class abc169_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        }

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

    static class abc169_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        }

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

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

    static class abc169_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int N = in.nextInt();
            long a[] = new long[N];
            for (int i = 0; i < N; i++) {
                long by = in.nextLong();
                if (by == 0) {
                    if (by == 0) {
                        out.println(0);
                        return;
                    }
                } else {
                    a[i] = by;
                }
            }
        /*
        BigInteger multi = new BigInteger(0);
        long max = 1000000000000000000l;
        if (multi.compareTo(BigInteger.valueOf(0)) ==0) {
            out.println(0);
            return;
        }
        */
            long wkval = 1;
            for (int i = 0; i < N; i++) {
                if (a[i] == 1) {
                    continue;
                }
                if (a[i] <= (1000000000000000000l / wkval)) {
                    wkval *= a[i];
                } else {
                    out.println(-1);
                    return;
                }
            /*
            if (multi.compareTo(BigInteger.valueOf(1000000000000000000l/multi.longValue())) ==1) {
                out.println(-1);
                return;
            }
            multi =multi.multiply(BigInteger.valueOf(by));
            */
            }
            out.println(wkval);
        }

    }
}

