import java.math.BigDecimal;
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigDecimal[] a = new BigDecimal[n];
 
        BigDecimal result = new BigDecimal(1);
        BigDecimal max = new BigDecimal(1000000000000000000L);
        for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }
 
        for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        }
 
        System.out.println(result);
    }
} import java.math.BigDecimal; BigDecimal java.math 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();
        BigDecimal[] a = new BigDecimal[n];
 
        BigDecimal result = new BigDecimal(1);
        BigDecimal max = new BigDecimal(1000000000000000000L);
        for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }
 
        for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        }
 
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigDecimal[] a = new BigDecimal[n];
 
        BigDecimal result = new BigDecimal(1);
        BigDecimal max = new BigDecimal(1000000000000000000L);
        for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }
 
        for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        }
 
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigDecimal[] a = new BigDecimal[n];
 
        BigDecimal result = new BigDecimal(1);
        BigDecimal max = new BigDecimal(1000000000000000000L);
        for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }
 
        for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        }
 
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc BigDecimal[] a = new BigDecimal[n]; a new BigDecimal[n] n BigDecimal result = new BigDecimal(1); result new BigDecimal(1) BigDecimal max = new BigDecimal(1000000000000000000L); max new BigDecimal(1000000000000000000L) for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        } int i=0; int i=0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        } {
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        } a[i] = sc.nextBigDecimal() a[i] a i sc.nextBigDecimal() sc.nextBigDecimal sc if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            } a[i].compareTo(BigDecimal.ZERO) == 0 a[i].compareTo(BigDecimal.ZERO) a[i].compareTo a[i] a i BigDecimal.ZERO BigDecimal BigDecimal.ZERO 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        } int i=0; int i=0; i 0 i < n i n i++ i++ i {
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        } {
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        } result = result.multiply(a[i]) result result.multiply(a[i]) result.multiply result a[i] a i if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            } result.compareTo(max) > 0 result.compareTo(max) result.compareTo result max 0 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigDecimal[] a = new BigDecimal[n];
 
        BigDecimal result = new BigDecimal(1);
        BigDecimal max = new BigDecimal(1000000000000000000L);
        for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }
 
        for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        }
 
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigDecimal[] a = new BigDecimal[n];
 
        BigDecimal result = new BigDecimal(1);
        BigDecimal max = new BigDecimal(1000000000000000000L);
        for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }
 
        for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        }
 
        System.out.println(result);
    }
} Main
import java.math.BigDecimal;
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigDecimal[] a = new BigDecimal[n];
 
        BigDecimal result = new BigDecimal(1);
        BigDecimal max = new BigDecimal(1000000000000000000L);
        for(int i=0; i < n; i++){
            a[i] = sc.nextBigDecimal();
            if(a[i].compareTo(BigDecimal.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }
 
        for(int i=0; i < n; i++){
            result = result.multiply(a[i]);
            if(result.compareTo(max) > 0){
                System.out.println(-1);
                return;
            }
        }
 
        System.out.println(result);
    }
}