import java.util.*;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        }
    }
} Main public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        }
    } main {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        }
    } try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        } {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long[] a = new long[N]; a new long[N] N for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                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] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            } {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            } a[i] = Long.parseLong(sc.next()) a[i] a i Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next 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 total = 1L; total 1L long LIMIT = 1000000000000000000L; LIMIT 1000000000000000000L for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            } {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            } if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                } a[i] <= LIMIT / total a[i] a i LIMIT / total LIMIT total {
                    total *= a[i];
                } total *= a[i] total a[i] a i {
                    System.out.println(-1);
                    return;
                } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            // Input
            int N = Integer.parseInt(sc.next());
            long[] a = new long[N];
            for (int i = 0; i < N; i++) {
                a[i] = Long.parseLong(sc.next());
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }

            // Calc
            long total = 1L;
            long LIMIT = 1000000000000000000L;
            for (int i = 0; i < N; i++) {
                if (a[i] <= LIMIT / total) {
                    total *= a[i];
                } else {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(total);
        }
    }
}