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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Eric
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(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, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        }

    }

    static class FastReader {
        public BufferedReader br;
        public StringTokenizer st;
        String context = null;

        public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        }

        public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        }

        public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        }

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

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

        public long[] nextArrLong(int n) {
            long[] a = new long[n];
            for (int i = 0; i < a.length; i++)
                a[i] = nextLong();
            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.io.PrintStream; PrintStream java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util import java.io.BufferedReader; BufferedReader 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;
        FastReader in = new FastReader(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, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        }

    }

    static class FastReader {
        public BufferedReader br;
        public StringTokenizer st;
        String context = null;

        public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        }

        public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        }

        public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        }

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

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

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

    }
} Main public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(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;
        FastReader in = new FastReader(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 FastReader in = new FastReader(inputStream); in new FastReader(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, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        }

    } BMultiplication2 public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        } solve {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        } int n = in.nextInt(); n in.nextInt() in.nextInt in long[] a = in.nextArrLong(n); a in.nextArrLong(n) in.nextArrLong in n long res = 1; res 1 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;
                } a[i] == 0 a[i] a i 0 {
                    out.println("0");
                    return;
                } out.println("0") out.println out "0" return; for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            } {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            } try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                } catch (Exception e) {
                    out.println("-1");
                    return;
                } Exception e {
                    out.println("-1");
                    return;
                } out.println("-1") out.println out "-1" return; {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } res = Math.multiplyExact(res, a[i]) res Math.multiplyExact(res, a[i]) Math.multiplyExact Math res a[i] a i if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    } res > 1_000_000_000_000_000_000L res 1_000_000_000_000_000_000L {
                        out.println("-1");
                        return;
                    } out.println("-1") out.println out "-1" return; out.println(res) out.println out res int testNumber testNumber FastReader in in PrintWriter out out static class FastReader {
        public BufferedReader br;
        public StringTokenizer st;
        String context = null;

        public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        }

        public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        }

        public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        }

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

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

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

    } FastReader public BufferedReader br; br public StringTokenizer st; st String context = null; context null public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        } FastReader {
            this(new InputStreamReader(in));
        } this(new InputStreamReader(in)) this new InputStreamReader(in) InputStream in in public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        } FastReader {
            br = new BufferedReader(input);
        } br = new BufferedReader(input) br new BufferedReader(input) InputStreamReader input input public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        } next {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        } if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            } context != null context null {
                System.err.print("[" + context + "] Wait for input ...");
            } System.err.print("[" + context + "] Wait for input ...") System.err.print System.err System System.err "[" + context + "] Wait for input ..." "[" + context + "] Wait for input ..." "[" context "] Wait for input ..." while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            } try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                } IOException e {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                } e.printStackTrace() e.printStackTrace e throw new RuntimeException("Could not read"); new RuntimeException("Could not read") {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } String s = br.readLine(); s br.readLine() br.readLine br if (s == null)
                        return null; s == null s null return null; null st = new StringTokenizer(s) st new StringTokenizer(s) String res = st.nextToken(); res st.nextToken() st.nextToken st if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            } context != null context null {
                System.err.println("[" + context + "] ... received : " + res);
            } System.err.println("[" + context + "] ... received : " + res) System.err.println System.err System System.err "[" + context + "] ... received : " + res "] ... received : " "[" + context + "] ... received : " + res "[" context "] ... received : " res return res; res 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[] nextArrLong(int n) {
            long[] a = new long[n];
            for (int i = 0; i < a.length; i++)
                a[i] = nextLong();
            return a;
        } nextArrLong {
            long[] a = new long[n];
            for (int i = 0; i < a.length; i++)
                a[i] = nextLong();
            return a;
        } long[] a = new long[n]; a new long[n] n for (int i = 0; i < a.length; i++)
                a[i] = nextLong(); int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(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, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        }

    }

    static class FastReader {
        public BufferedReader br;
        public StringTokenizer st;
        String context = null;

        public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        }

        public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        }

        public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        }

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

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

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

    }
} public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(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, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        }

    }

    static class FastReader {
        public BufferedReader br;
        public StringTokenizer st;
        String context = null;

        public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        }

        public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        }

        public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        }

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

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

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

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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Eric
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(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, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] a = in.nextArrLong(n);
            long res = 1;
            for (int i = 0; i < n; i++)
                if (a[i] == 0) {
                    out.println("0");
                    return;
                }
            for (int i = 0; i < n; i++) {
                try {
                    res = Math.multiplyExact(res, a[i]);
                    if (res > 1_000_000_000_000_000_000L) {
                        out.println("-1");
                        return;
                    }
                } catch (Exception e) {
                    out.println("-1");
                    return;
                }
            }
            out.println(res);
            //out.print("Case #"+ testNumber + ": ");
        }

    }

    static class FastReader {
        public BufferedReader br;
        public StringTokenizer st;
        String context = null;

        public FastReader(InputStream in) {
            this(new InputStreamReader(in));
        }

        public FastReader(InputStreamReader input) {
            br = new BufferedReader(input);
        }

        public String next() {
            if (context != null) {
                System.err.print("[" + context + "] Wait for input ...");
            }
            while (st == null || !st.hasMoreElements()) {
                try {
                    String s = br.readLine();
                    if (s == null)
                        return null;
                    st = new StringTokenizer(s);
                } catch (IOException e) {
                    e.printStackTrace();
                    throw new RuntimeException("Could not read");
                }
            }
            String res = st.nextToken();
            if (context != null) {
                System.err.println("[" + context + "] ... received : " + res);
            }
            return res;
        }

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

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

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

    }
}

