import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigInteger; BigInteger java.math import java.util.Arrays; Arrays java.util public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        }
    }
} Main public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        }
    } main {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        }
    } try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        } {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] in = br.readLine().split(" "); in br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                a[i] = Long.parseLong(in[i]);
            } {
                a[i] = Long.parseLong(in[i]);
            } a[i] = Long.parseLong(in[i]) a[i] a i Long.parseLong(in[i]) Long.parseLong Long in[i] in i br.close() br.close br Arrays.sort(a) Arrays.sort Arrays a BigInteger ans = BigInteger.valueOf(1); ans BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            } long i a {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            } {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            } ans = ans.multiply(BigInteger.valueOf(i)) ans ans.multiply(BigInteger.valueOf(i)) ans.multiply ans BigInteger.valueOf(i) BigInteger.valueOf BigInteger i if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                } ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1 ans.compareTo(BigInteger.valueOf((long) 1e18)) ans.compareTo ans BigInteger.valueOf((long) 1e18) BigInteger.valueOf BigInteger (long) 1e18 1 {
                    System.out.println(-1);
                    return;
                } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        }
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;

public class Main {
    public static void main(String[] args) throws Exception {
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

            int n = Integer.parseInt(br.readLine());
            String[] in = br.readLine().split(" ");
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = Long.parseLong(in[i]);
            }

            br.close();

            Arrays.sort(a);

            BigInteger ans = BigInteger.valueOf(1);
            for (long i : a) {
                ans = ans.multiply(BigInteger.valueOf(i));
                if (ans.compareTo(BigInteger.valueOf((long) 1e18)) == 1) {
                    System.out.println(-1);
                    return;
                }
            }

            System.out.println(ans);

        }
    }
}