import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {

        Scanner in = new Scanner(System.in);
//        Scanner in = new Scanner(new File("input.txt"));

        int n = in.nextInt();
        BigInteger b = new BigInteger("1");
        BigInteger c = new BigInteger("1000000000000000000");
        long[] nums = new long[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        }
        Arrays.sort(nums);

        if (nums[0] == 0) {
            System.out.println(0);
            return;
        }

        for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }

        System.out.println(b.toString());
    }
} import java.io.FileNotFoundException; FileNotFoundException java.io import java.math.BigInteger; BigInteger java.math import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) throws FileNotFoundException {

        Scanner in = new Scanner(System.in);
//        Scanner in = new Scanner(new File("input.txt"));

        int n = in.nextInt();
        BigInteger b = new BigInteger("1");
        BigInteger c = new BigInteger("1000000000000000000");
        long[] nums = new long[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        }
        Arrays.sort(nums);

        if (nums[0] == 0) {
            System.out.println(0);
            return;
        }

        for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }

        System.out.println(b.toString());
    }
} Main public static void main(String[] args) throws FileNotFoundException {

        Scanner in = new Scanner(System.in);
//        Scanner in = new Scanner(new File("input.txt"));

        int n = in.nextInt();
        BigInteger b = new BigInteger("1");
        BigInteger c = new BigInteger("1000000000000000000");
        long[] nums = new long[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        }
        Arrays.sort(nums);

        if (nums[0] == 0) {
            System.out.println(0);
            return;
        }

        for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }

        System.out.println(b.toString());
    } main {

        Scanner in = new Scanner(System.in);
//        Scanner in = new Scanner(new File("input.txt"));

        int n = in.nextInt();
        BigInteger b = new BigInteger("1");
        BigInteger c = new BigInteger("1000000000000000000");
        long[] nums = new long[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        }
        Arrays.sort(nums);

        if (nums[0] == 0) {
            System.out.println(0);
            return;
        }

        for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }

        System.out.println(b.toString());
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in BigInteger b = new BigInteger("1"); b new BigInteger("1") BigInteger c = new BigInteger("1000000000000000000"); c new BigInteger("1000000000000000000") long[] nums = new long[n]; nums new long[n] n for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            nums[i] = in.nextLong();
        } {
            nums[i] = in.nextLong();
        } nums[i] = in.nextLong() nums[i] nums i in.nextLong() in.nextLong in Arrays.sort(nums) Arrays.sort Arrays nums if (nums[0] == 0) {
            System.out.println(0);
            return;
        } nums[0] == 0 nums[0] nums 0 0 {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        } {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        } b = b.multiply(new BigInteger(String.valueOf(nums[i]))) b b.multiply(new BigInteger(String.valueOf(nums[i]))) b.multiply b new BigInteger(String.valueOf(nums[i])) if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            } b.compareTo(c) > 0 b.compareTo(c) b.compareTo b c 0 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(b.toString()) System.out.println System.out System System.out b.toString() b.toString b String[] args args public class Main {
    public static void main(String[] args) throws FileNotFoundException {

        Scanner in = new Scanner(System.in);
//        Scanner in = new Scanner(new File("input.txt"));

        int n = in.nextInt();
        BigInteger b = new BigInteger("1");
        BigInteger c = new BigInteger("1000000000000000000");
        long[] nums = new long[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        }
        Arrays.sort(nums);

        if (nums[0] == 0) {
            System.out.println(0);
            return;
        }

        for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }

        System.out.println(b.toString());
    }
} public class Main {
    public static void main(String[] args) throws FileNotFoundException {

        Scanner in = new Scanner(System.in);
//        Scanner in = new Scanner(new File("input.txt"));

        int n = in.nextInt();
        BigInteger b = new BigInteger("1");
        BigInteger c = new BigInteger("1000000000000000000");
        long[] nums = new long[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        }
        Arrays.sort(nums);

        if (nums[0] == 0) {
            System.out.println(0);
            return;
        }

        for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }

        System.out.println(b.toString());
    }
} Main
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {

        Scanner in = new Scanner(System.in);
//        Scanner in = new Scanner(new File("input.txt"));

        int n = in.nextInt();
        BigInteger b = new BigInteger("1");
        BigInteger c = new BigInteger("1000000000000000000");
        long[] nums = new long[n];
        for (int i = 0; i < n; i++) {
            nums[i] = in.nextLong();
        }
        Arrays.sort(nums);

        if (nums[0] == 0) {
            System.out.println(0);
            return;
        }

        for (int i = 0; i < n; i++) {
            b = b.multiply(new BigInteger(String.valueOf(nums[i])));

            if (b.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }

        System.out.println(b.toString());
    }
}
