import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        long ans = 1L;
        long std = 1000000000000000000L;
        for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        long ans = 1L;
        long std = 1000000000000000000L;
        for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        long ans = 1L;
        long std = 1000000000000000000L;
        for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        long ans = 1L;
        long std = 1000000000000000000L;
        for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int time = sc.nextInt(); time sc.nextInt() sc.nextInt sc long ans = 1L; ans 1L long std = 1000000000000000000L; std 1000000000000000000L for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        } int i = 0; int i = 0; i 0 i < time i time i++ i++ i {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        } {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        } long mul = sc.nextLong(); mul sc.nextLong() sc.nextLong sc if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            } mul == 0 mul 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            } ans == -1 ans -1 1 {
                continue;
            } continue; if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            } mul > std / ans mul std / ans std ans {
                ans = -1;
            } ans = -1 ans -1 1 {
                ans *= mul;
            } ans *= mul ans mul 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 time = sc.nextInt();
        long ans = 1L;
        long std = 1000000000000000000L;
        for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        long ans = 1L;
        long std = 1000000000000000000L;
        for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        }
        System.out.println(ans);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        long ans = 1L;
        long std = 1000000000000000000L;
        for (int i = 0; i < time; i++) {
            long mul = sc.nextLong();
            if(mul == 0){
                System.out.println(0);
                return;
            }else if(ans == -1){
                continue;
            }else if(mul > std / ans){
                ans = -1;
            }else{
                ans *= mul;
            }
        }
        System.out.println(ans);
    }
}
