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;
        InputReader in = new InputReader(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, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return 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.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;
        InputReader in = new InputReader(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, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        }

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(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;
        InputReader in = new InputReader(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 InputReader in = new InputReader(inputStream); in new InputReader(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, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        }

    } BMultiplication2 public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        } solve {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in long[] a = in.readLongArray(n); a in.readLongArray(n) in.readLongArray in n for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            } long x a {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            } {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            } if (x == 0) {
                    out.println(0);
                    return;
                } x == 0 x 0 {
                    out.println(0);
                    return;
                } out.println(0) out.println out 0 return; final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L); MAX BigInteger.valueOf(1_000_000_000_000_000_000L) BigInteger.valueOf BigInteger 1_000_000_000_000_000_000L BigInteger answer = BigInteger.ONE; answer BigInteger.ONE BigInteger BigInteger.ONE for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            } long x a {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            } {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            } answer = answer.multiply(BigInteger.valueOf(x)) answer answer.multiply(BigInteger.valueOf(x)) answer.multiply answer BigInteger.valueOf(x) BigInteger.valueOf BigInteger x if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                } answer.compareTo(MAX) > 0 answer.compareTo(MAX) answer.compareTo answer MAX 0 {
                    out.println(-1);
                    return;
                } out.println(-1) out.println out -1 1 return; out.println(answer) out.println out answer int testNumber testNumber InputReader in in PrintWriter out out static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        }

    } InputReader public final BufferedReader reader; reader public StringTokenizer tokenizer; tokenizer public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } InputReader {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } reader = new BufferedReader(new InputStreamReader(stream), 32768) reader new BufferedReader(new InputStreamReader(stream), 32768) tokenizer = null tokenizer null InputStream stream stream public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } next {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        } readLongArray {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        } long[] x = new long[n]; x new long[n] n for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                x[i] = nextLong();
            } {
                x[i] = nextLong();
            } x[i] = nextLong() x[i] x i nextLong() nextLong return x; x int n n public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(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, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        }

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(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, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        }

    }
} 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;
        InputReader in = new InputReader(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, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.readLongArray(n);

            for (long x : a) {
                if (x == 0) {
                    out.println(0);
                    return;
                }
            }

            final BigInteger MAX = BigInteger.valueOf(1_000_000_000_000_000_000L);

            BigInteger answer = BigInteger.ONE;
            for (long x : a) {
                answer = answer.multiply(BigInteger.valueOf(x));
                if (answer.compareTo(MAX) > 0) {
                    out.println(-1);
                    return;
                }
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public final BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

        public long[] readLongArray(int n) {
            long[] x = new long[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextLong();
            }
            return x;
        }

    }
}

