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[] a = new long[n];

        int count = 0;
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        }
        if (flg) {
            System.out.println(0);
            return;
        }

        long ans = 1;
        long tmp = 1000000000000000000L;
        long std = 1000000000000000000L;
        for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        }

        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[] a = new long[n];

        int count = 0;
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        }
        if (flg) {
            System.out.println(0);
            return;
        }

        long ans = 1;
        long tmp = 1000000000000000000L;
        long std = 1000000000000000000L;
        for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        }

        System.out.println(ans);

    }
} Main public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];

        int count = 0;
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        }
        if (flg) {
            System.out.println(0);
            return;
        }

        long ans = 1;
        long tmp = 1000000000000000000L;
        long std = 1000000000000000000L;
        for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        }

        System.out.println(ans);

    } main {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];

        int count = 0;
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        }
        if (flg) {
            System.out.println(0);
            return;
        }

        long ans = 1;
        long tmp = 1000000000000000000L;
        long std = 1000000000000000000L;
        for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        }

        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[] a = new long[n]; a new long[n] n int count = 0; count 0 boolean flg = false; flg false for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        } {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if (a[i] == 0) {
                flg = true;
            } a[i] == 0 a[i] a i 0 {
                flg = true;
            } flg = true flg true if (flg) {
            System.out.println(0);
            return;
        } flg {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; long ans = 1; ans 1 long tmp = 1000000000000000000L; tmp 1000000000000000000L long std = 1000000000000000000L; std 1000000000000000000L for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        } {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        } ans = ans * a[i] ans ans * a[i] ans a[i] a i tmp = tmp / a[i] tmp tmp / a[i] tmp a[i] a i if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            } std < ans || ans < 0 || tmp == 0 std < ans || ans < 0 || tmp == 0 std < ans std ans ans < 0 ans 0 tmp == 0 tmp 0 {
                System.out.println("-1");
                return;
            } System.out.println("-1") System.out.println System.out System System.out "-1" return; 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[] a = new long[n];

        int count = 0;
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        }
        if (flg) {
            System.out.println(0);
            return;
        }

        long ans = 1;
        long tmp = 1000000000000000000L;
        long std = 1000000000000000000L;
        for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        }

        System.out.println(ans);

    }
} public class Main {
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];

        int count = 0;
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        }
        if (flg) {
            System.out.println(0);
            return;
        }

        long ans = 1;
        long tmp = 1000000000000000000L;
        long std = 1000000000000000000L;
        for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        }

        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[] a = new long[n];

        int count = 0;
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if (a[i] == 0) {
                flg = true;
            }
        }
        if (flg) {
            System.out.println(0);
            return;
        }

        long ans = 1;
        long tmp = 1000000000000000000L;
        long std = 1000000000000000000L;
        for (int i = 0; i < n; i++) {
            ans = ans * a[i];
            tmp = tmp / a[i];
            if (std < ans || ans < 0 || tmp == 0) {
                System.out.println("-1");
                return;
            }
        }

        System.out.println(ans);

    }
}