import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

        public long Long() {
            return Long.parseLong(next());
        }

        public long[] Long(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        }

    }
}
 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.StringTokenizer; StringTokenizer java.util import java.math.BigInteger; BigInteger java.math import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

        public long Long() {
            return Long.parseLong(next());
        }

        public long[] Long(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new 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 MyScanner in = new MyScanner(inputStream); in new MyScanner(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) B solver = new B(); solver new B() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        }

    } B public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        } solve {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        } int N = in.Int(); N in.Int() in.Int in long[] A = in.Long(N); A in.Long(N) in.Long in N for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            } {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            } if (A[i] == 0) {
                    out.println(0);
                    return;
                } A[i] == 0 A[i] A i 0 {
                    out.println(0);
                    return;
                } out.println(0) out.println out 0 return; BigInteger max = BigInteger.valueOf((long) 1e18); max BigInteger.valueOf((long) 1e18) BigInteger.valueOf BigInteger (long) 1e18 BigInteger a = BigInteger.ONE; a BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            } {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            } a = a.multiply(BigInteger.valueOf(A[i])) a a.multiply(BigInteger.valueOf(A[i])) a.multiply a BigInteger.valueOf(A[i]) BigInteger.valueOf BigInteger A[i] A i if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                } a.compareTo(max) > 0 a.compareTo(max) a.compareTo a max 0 {
                    out.println(-1);
                    return;
                } out.println(-1) out.println out -1 1 return; out.println(a.toString()) out.println out a.toString() a.toString a int testNumber testNumber MyScanner in in PrintWriter out out static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

        public long Long() {
            return Long.parseLong(next());
        }

        public long[] Long(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        }

    } MyScanner private BufferedReader in; in private StringTokenizer st; st public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        } MyScanner {
            in = new BufferedReader(new InputStreamReader(stream));
        } in = new BufferedReader(new InputStreamReader(stream)) in new BufferedReader(new InputStreamReader(stream)) InputStream stream stream public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            } try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                } catch (IOException e) {
                    return null;
                } IOException e {
                    return null;
                } return null; null {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } String rl = in.readLine(); rl in.readLine() in.readLine in if (rl == null) {
                        return null;
                    } rl == null rl null {
                        return null;
                    } return null; null st = new StringTokenizer(rl) st new StringTokenizer(rl) return st.nextToken(); st.nextToken() st.nextToken st public int Int() {
            return Integer.parseInt(next());
        } Int {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long Long() {
            return Long.parseLong(next());
        } Long {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public long[] Long(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        } Long {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        } long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++) {
                a[i] = Long();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = Long();
            } {
                a[i] = Long();
            } a[i] = Long() a[i] a i Long() Long return a; a int n n public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

        public long Long() {
            return Long.parseLong(next());
        }

        public long[] Long(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        }

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

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

        public long Long() {
            return Long.parseLong(next());
        }

        public long[] Long(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        }

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            long[] A = in.Long(N);

            for (int i = 0; i < N; i++) {
                if (A[i] == 0) {
                    out.println(0);
                    return;
                }
            }

            BigInteger max = BigInteger.valueOf((long) 1e18);

            BigInteger a = BigInteger.ONE;
            for (int i = 0; i < N; i++) {
                a = a.multiply(BigInteger.valueOf(A[i]));
                if (a.compareTo(max) > 0) {
                    out.println(-1);
                    return;
                }
            }
            out.println(a.toString());
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

        public long Long() {
            return Long.parseLong(next());
        }

        public long[] Long(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long();
            }
            return a;
        }

    }
}

