import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal[] nums = new BigDecimal[N];
        for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        }
        final BigDecimal limit = new BigDecimal("1000000000000000000");
        final BigDecimal zero = new BigDecimal(0);
        Arrays.sort(nums);
        BigDecimal ans = nums[0];
        if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        }
    }
} import java.math.BigDecimal; BigDecimal 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) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal[] nums = new BigDecimal[N];
        for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        }
        final BigDecimal limit = new BigDecimal("1000000000000000000");
        final BigDecimal zero = new BigDecimal(0);
        Arrays.sort(nums);
        BigDecimal ans = nums[0];
        if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal[] nums = new BigDecimal[N];
        for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        }
        final BigDecimal limit = new BigDecimal("1000000000000000000");
        final BigDecimal zero = new BigDecimal(0);
        Arrays.sort(nums);
        BigDecimal ans = nums[0];
        if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal[] nums = new BigDecimal[N];
        for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        }
        final BigDecimal limit = new BigDecimal("1000000000000000000");
        final BigDecimal zero = new BigDecimal(0);
        Arrays.sort(nums);
        BigDecimal ans = nums[0];
        if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc BigDecimal[] nums = new BigDecimal[N]; nums new BigDecimal[N] N for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            nums[i] = new BigDecimal(sc.next());
        } {
            nums[i] = new BigDecimal(sc.next());
        } nums[i] = new BigDecimal(sc.next()) nums[i] nums i new BigDecimal(sc.next()) final BigDecimal limit = new BigDecimal("1000000000000000000"); limit new BigDecimal("1000000000000000000") final BigDecimal zero = new BigDecimal(0); zero new BigDecimal(0) Arrays.sort(nums) Arrays.sort Arrays nums BigDecimal ans = nums[0]; ans nums[0] nums 0 if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        } ans.longValue() == 0 ans.longValue() ans.longValue ans 0 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        } boolean over = false; over false for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            } {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            } ans = ans.multiply(nums[i]) ans ans.multiply(nums[i]) ans.multiply ans nums[i] nums i if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                } limit.subtract(ans).compareTo(zero) < 0 limit.subtract(ans).compareTo(zero) limit.subtract(ans).compareTo limit.subtract(ans) limit.subtract limit ans zero 0 {
                    System.out.println(-1);
                    over = true;
                    break;
                } System.out.println(-1) System.out.println System.out System System.out -1 1 over = true over true break; if (!over) {
                System.out.println(ans.longValue());
            } !over over {
                System.out.println(ans.longValue());
            } System.out.println(ans.longValue()) System.out.println System.out System System.out ans.longValue() ans.longValue ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal[] nums = new BigDecimal[N];
        for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        }
        final BigDecimal limit = new BigDecimal("1000000000000000000");
        final BigDecimal zero = new BigDecimal(0);
        Arrays.sort(nums);
        BigDecimal ans = nums[0];
        if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal[] nums = new BigDecimal[N];
        for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        }
        final BigDecimal limit = new BigDecimal("1000000000000000000");
        final BigDecimal zero = new BigDecimal(0);
        Arrays.sort(nums);
        BigDecimal ans = nums[0];
        if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        }
    }
} Main
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        BigDecimal[] nums = new BigDecimal[N];
        for (int i = 0; i < N; i++) {
            nums[i] = new BigDecimal(sc.next());
        }
        final BigDecimal limit = new BigDecimal("1000000000000000000");
        final BigDecimal zero = new BigDecimal(0);
        Arrays.sort(nums);
        BigDecimal ans = nums[0];
        if (ans.longValue() == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans = ans.multiply(nums[i]);
                if (limit.subtract(ans).compareTo(zero) < 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans.longValue());
            }
        }
    }
}