
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static long check = 1000000000000000000L;

    public static void main(String[] args) {
        int n = sc.nextInt();
        long arr[] = new long[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }
        long ans = 1;
        for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        }
        for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        }
        if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    static Scanner sc = new Scanner(System.in);
    static long check = 1000000000000000000L;

    public static void main(String[] args) {
        int n = sc.nextInt();
        long arr[] = new long[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }
        long ans = 1;
        for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        }
        for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        }
        if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static long check = 1000000000000000000L; check 1000000000000000000L public static void main(String[] args) {
        int n = sc.nextInt();
        long arr[] = new long[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }
        long ans = 1;
        for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        }
        for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        }
        if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    } main {
        int n = sc.nextInt();
        long arr[] = new long[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }
        long ans = 1;
        for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        }
        for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        }
        if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long arr[] = new long[n]; arr new long[n] n for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            arr[i] = sc.nextLong();
        } {
            arr[i] = sc.nextLong();
        } arr[i] = sc.nextLong() arr[i] arr i sc.nextLong() sc.nextLong sc long ans = 1; ans 1 for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        } {
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        } long tmp = ans; tmp ans ans *= arr[i] ans arr[i] arr i if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            } ans < 0 || ans < tmp ans < 0 ans 0 ans < tmp ans tmp {
                ans = -1;
                break;
            } ans = -1 ans -1 1 break; for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        } {
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        } if (arr[i] == 0){
                ans = 0;
                break;
            } arr[i] == 0 arr[i] arr i 0 {
                ans = 0;
                break;
            } ans = 0 ans 0 break; if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        } ans > check ans check {
            System.out.println(-1);
        } System.out.println(-1) System.out.println System.out System System.out -1 1 {
            System.out.println(ans);
        } System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    static Scanner sc = new Scanner(System.in);
    static long check = 1000000000000000000L;

    public static void main(String[] args) {
        int n = sc.nextInt();
        long arr[] = new long[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }
        long ans = 1;
        for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        }
        for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        }
        if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    }
} public class Main {
    static Scanner sc = new Scanner(System.in);
    static long check = 1000000000000000000L;

    public static void main(String[] args) {
        int n = sc.nextInt();
        long arr[] = new long[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }
        long ans = 1;
        for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        }
        for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        }
        if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    }
} Main

import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    static long check = 1000000000000000000L;

    public static void main(String[] args) {
        int n = sc.nextInt();
        long arr[] = new long[n];
        for (int i = 0; i < n; i++){
            arr[i] = sc.nextLong();
        }
        long ans = 1;
        for (int i = 0; i < n; i++){
            long tmp = ans;
            ans *= arr[i];
            if (ans < 0 || ans < tmp){
                ans = -1;
                break;
            }
        }
        for (int i = 0; i < n; i++){
            if (arr[i] == 0){
                ans = 0;
                break;
            }
        }
        if (ans > check){
            System.out.println(-1);
        } else {
            System.out.println(ans);
        }
    }
}
