import static java.lang.Math.multiplyExact;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        }

        Arrays.sort(a);

        if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        }

        Long result = a[0];

        for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        }
        System.out.print(result);
    }
} import static java.lang.Math.multiplyExact; import static java.lang.Math.multiplyExact; import static java.lang.Math.multiplyExact; import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        }

        Arrays.sort(a);

        if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        }

        Long result = a[0];

        for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        }
        System.out.print(result);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        }

        Arrays.sort(a);

        if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        }

        Long result = a[0];

        for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        }
        System.out.print(result);
    } main {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        }

        Arrays.sort(a);

        if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        }

        Long result = a[0];

        for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        }
        System.out.print(result);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner Long[] a = new Long[n]; a new Long[n] n Long limit = (long)Math.pow(10,18); limit (long)Math.pow(10,18) Math.pow Math 10 18 for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = scanner.nextLong();
        } {
            a[i] = scanner.nextLong();
        } a[i] = scanner.nextLong() a[i] a i scanner.nextLong() scanner.nextLong scanner Arrays.sort(a) Arrays.sort Arrays a if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        } a[0] == 0 a[0] a 0 0 {
            System.out.print(0);
            System.exit(0);
        } System.out.print(0) System.out.print System.out System System.out 0 System.exit(0) System.exit System 0 Long result = a[0]; result a[0] a 0 for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        } {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        } try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            } Exception e {
                System.out.print(-1);
                System.exit(0);
            } System.out.print(-1) System.out.print System.out System System.out -1 1 System.exit(0) System.exit System 0 {
                result = multiplyExact(result,a[i]);
            } result = multiplyExact(result,a[i]) result multiplyExact(result,a[i]) multiplyExact result a[i] a i if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            } result > limit result limit {
                System.out.print(-1);
                System.exit(0);
            } System.out.print(-1) System.out.print System.out System System.out -1 1 System.exit(0) System.exit System 0 System.out.print(result) System.out.print System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        }

        Arrays.sort(a);

        if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        }

        Long result = a[0];

        for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        }
        System.out.print(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        }

        Arrays.sort(a);

        if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        }

        Long result = a[0];

        for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        }
        System.out.print(result);
    }
} Main
import static java.lang.Math.multiplyExact;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Integer n = scanner.nextInt();
        Long[] a = new Long[n];
        Long limit = (long)Math.pow(10,18);

        for (int i = 0; i < n; i++) {
            a[i] = scanner.nextLong();
        }

        Arrays.sort(a);

        if (a[0] == 0){
            System.out.print(0);
            System.exit(0);
        }

        Long result = a[0];

        for (int i = 1; i < n; i++) {
            try {
                result = multiplyExact(result,a[i]);
            } catch (Exception e) {
                System.out.print(-1);
                System.exit(0);
            }
            if (result > limit) {
                System.out.print(-1);
                System.exit(0);
            }
        }
        System.out.print(result);
    }
}
