import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        }
    } try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        } {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) long max = (long) 1e18; max (long) 1e18 int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] A = new long[N]; A new long[N] N for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            } {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            } A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc if (A[i] == 0) {
                    System.out.println(0);
                    return;
                } A[i] == 0 A[i] A i 0 {
                    System.out.println(0);
                    return;
                } System.out.println(0) System.out.println System.out System System.out 0 return; long multi = 1; multi 1 for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            } {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            } if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                } multi > max / A[i] multi max / A[i] max A[i] A i {
                    System.out.println(-1);
                    return;
                } System.out.println(-1) System.out.println System.out System System.out -1 1 return; multi *= A[i] multi A[i] A i System.out.println(multi) System.out.println System.out System System.out multi String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            long max = (long) 1e18;
            int N = sc.nextInt();
            long[] A = new long[N];
            for (int i = 0; i < N; i++) {
                A[i] = sc.nextLong();
                if (A[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            long multi = 1;
            for (int i = 0; i < N; i++) {
                if (multi > max / A[i]) {
                    System.out.println(-1);
                    return;
                }
                multi *= A[i];
            }
            System.out.println(multi);
        }
    }
}
