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();
        long[] nums = new long[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        }
        Arrays.sort(nums);
        long ans = nums[0];
        if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        }
    }
} 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();
        long[] nums = new long[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        }
        Arrays.sort(nums);
        long ans = nums[0];
        if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        }
        Arrays.sort(nums);
        long ans = nums[0];
        if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        }
        Arrays.sort(nums);
        long ans = nums[0];
        if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] nums = new long[N]; nums new long[N] N for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            nums[i] = sc.nextLong();
        } {
            nums[i] = sc.nextLong();
        } nums[i] = sc.nextLong() nums[i] nums i sc.nextLong() sc.nextLong sc Arrays.sort(nums) Arrays.sort Arrays nums long ans = nums[0]; ans nums[0] nums 0 if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        } ans == 0 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 *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        } boolean over = false; over false for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            } int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            } {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            } ans *= nums[i] ans nums[i] nums i if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                } 1000000000000000000L < ans || ans <= 0 1000000000000000000L < ans 1000000000000000000L ans ans <= 0 ans 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);
            } !over over {
                System.out.println(ans);
            } 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) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        }
        Arrays.sort(nums);
        long ans = nums[0];
        if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        }
        Arrays.sort(nums);
        long ans = nums[0];
        if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        }
    }
} Main
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();
        long[] nums = new long[N];
        for (int i = 0; i < N; i++) {
            nums[i] = sc.nextLong();
        }
        Arrays.sort(nums);
        long ans = nums[0];
        if (ans == 0) {
            System.out.println(0);
        } else {
            boolean over = false;
            for (int i = 1; i < N; i++) {
                ans *= nums[i];
                if (1000000000000000000L < ans || ans <= 0) {
                    System.out.println(-1);
                    over = true;
                    break;
                }
            }
            if (!over) {
                System.out.println(ans);
            }
        }
    }
}