import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
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
 *
 * @author Tarek
 */
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[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        }

    }

    static class InputReader {
        public 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 long nextLong() {
            return Long.parseLong(next());
        }

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

    }
}
 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.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[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        }

    }

    static class InputReader {
        public 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 long nextLong() {
            return Long.parseLong(next());
        }

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

    }
} 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[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        }

    } BMultiplication2 public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long a[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        } solve {
            int n = in.nextInt();
            long a[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        } int n = in.nextInt(); n in.nextInt() in.nextInt in long a[] = new long[n]; a new long[n] n int f = 0; f 0 long sum2 = (long) Math.pow(10, 18); sum2 (long) Math.pow(10, 18) Math.pow Math 10 18 for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            } {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            } a[i] = in.nextLong() a[i] a i in.nextLong() in.nextLong in if (a[i] == 0) f = 1; a[i] == 0 a[i] a i 0 f = 1 f 1 if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            } f == 1 f 1 out.println("0") out.println out "0" {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            } int m = 0; m 0 long sum = 1; sum 1 for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                } {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                } if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    } (sum * a[i]) > sum2 (sum * a[i]) sum a[i] a i sum2 {
                        out.println("-1");
                        return;
                    } out.println("-1") out.println out "-1" return; if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    } 1000000000000000000L / sum < a[i] 1000000000000000000L / sum 1000000000000000000L sum a[i] a i {
                        out.println("-1");
                        return;
                    } out.println("-1") out.println out "-1" return; {
                        sum = sum * a[i];
                    } sum = sum * a[i] sum sum * a[i] sum a[i] a i out.println(sum) out.println out sum int testNumber testNumber InputReader in in PrintWriter out out static class InputReader {
        public 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 long nextLong() {
            return Long.parseLong(next());
        }

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

    } InputReader public 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 long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next 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 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[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        }

    }

    static class InputReader {
        public 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 long nextLong() {
            return Long.parseLong(next());
        }

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

    }
} 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[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        }

    }

    static class InputReader {
        public 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 long nextLong() {
            return Long.parseLong(next());
        }

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

    }
} Main
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
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
 *
 * @author Tarek
 */
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[] = new long[n];
            int f = 0;
            long sum2 = (long) Math.pow(10, 18);
            for (int i = 0; i < n; i++) {
                a[i] = in.nextLong();
                if (a[i] == 0) f = 1;
            }
            if (f == 1) out.println("0");
            else {
                int m = 0;
                long sum = 1;
                for (int i = 0; i < n; i++) {
                    if ((sum * a[i]) > sum2) {
                        out.println("-1");
                        return;
                    }
                    if (1000000000000000000L / sum < a[i]) {
                        out.println("-1");
                        return;
                    } else {
                        sum = sum * a[i];
                    }
                }
                out.println(sum);
            }
        }

    }

    static class InputReader {
        public 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 long nextLong() {
            return Long.parseLong(next());
        }

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

    }
}

