import java.math.BigDecimal;
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        sc.nextLine();
        String[] arr = sc.nextLine().split(" ");
        // 0
        if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        }

        BigDecimal ans = BigDecimal.ONE;
        BigDecimal max = new BigDecimal("1000000000000000000");
        boolean over = false;
        for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        }

        if(!over){
            System.out.println(ans);
        }
    }
} import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        sc.nextLine();
        String[] arr = sc.nextLine().split(" ");
        // 0
        if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        }

        BigDecimal ans = BigDecimal.ONE;
        BigDecimal max = new BigDecimal("1000000000000000000");
        boolean over = false;
        for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        }

        if(!over){
            System.out.println(ans);
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        sc.nextLine();
        String[] arr = sc.nextLine().split(" ");
        // 0
        if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        }

        BigDecimal ans = BigDecimal.ONE;
        BigDecimal max = new BigDecimal("1000000000000000000");
        boolean over = false;
        for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        }

        if(!over){
            System.out.println(ans);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        sc.nextLine();
        String[] arr = sc.nextLine().split(" ");
        // 0
        if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        }

        BigDecimal ans = BigDecimal.ONE;
        BigDecimal max = new BigDecimal("1000000000000000000");
        boolean over = false;
        for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        }

        if(!over){
            System.out.println(ans);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) sc.nextLine() sc.nextLine sc String[] arr = sc.nextLine().split(" "); arr sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        } Arrays.asList(arr).contains("0") Arrays.asList(arr).contains Arrays.asList(arr) Arrays.asList Arrays arr "0" {
            System.out.println(0);
            return;
        } System.out.println(0) System.out.println System.out System System.out 0 return; BigDecimal ans = BigDecimal.ONE; ans BigDecimal.ONE BigDecimal BigDecimal.ONE BigDecimal max = new BigDecimal("1000000000000000000"); max new BigDecimal("1000000000000000000") boolean over = false; over false for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        } String str arr {
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        } {
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        } ans = ans.multiply(new BigDecimal(str)) ans ans.multiply(new BigDecimal(str)) ans.multiply ans new BigDecimal(str) if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            } ans.compareTo(max) == 1 ans.compareTo(max) ans.compareTo ans max 1 {
                System.out.println(-1);
                over = true;
                break;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 over = true over true break; if(!over){
            System.out.println(ans);
        } !over over {
            System.out.println(ans);
        } 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);
        // 整数の入力
        sc.nextLine();
        String[] arr = sc.nextLine().split(" ");
        // 0
        if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        }

        BigDecimal ans = BigDecimal.ONE;
        BigDecimal max = new BigDecimal("1000000000000000000");
        boolean over = false;
        for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        }

        if(!over){
            System.out.println(ans);
        }
    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        sc.nextLine();
        String[] arr = sc.nextLine().split(" ");
        // 0
        if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        }

        BigDecimal ans = BigDecimal.ONE;
        BigDecimal max = new BigDecimal("1000000000000000000");
        boolean over = false;
        for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        }

        if(!over){
            System.out.println(ans);
        }
    }
} Main
import java.math.BigDecimal;
import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        // 整数の入力
        sc.nextLine();
        String[] arr = sc.nextLine().split(" ");
        // 0
        if(Arrays.asList(arr).contains("0")){
            System.out.println(0);
            return;
        }

        BigDecimal ans = BigDecimal.ONE;
        BigDecimal max = new BigDecimal("1000000000000000000");
        boolean over = false;
        for(String str : arr){
            ans = ans.multiply(new BigDecimal(str));

            // 上限
            if(ans.compareTo(max) == 1){
                System.out.println(-1);
                over = true;
                break;
            }
        }

        if(!over){
            System.out.println(ans);
        }
    }
}