import java.math.BigDecimal;
import java.util.*;

public class Main {

    static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        }
        BigDecimal d = new BigDecimal(a[0]);
        for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        }
        System.out.println(d.longValue());
        
        sc.close();

    }

} import java.math.BigDecimal; BigDecimal java.math import java.util.*; util.* java public class Main {

    static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        }
        BigDecimal d = new BigDecimal(a[0]);
        for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        }
        System.out.println(d.longValue());
        
        sc.close();

    }

} Main static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L); MAX new BigDecimal(1_000_000_000_000_000_000L) public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        }
        BigDecimal d = new BigDecimal(a[0]);
        for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        }
        System.out.println(d.longValue());
        
        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        }
        BigDecimal d = new BigDecimal(a[0]);
        for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        }
        System.out.println(d.longValue());
        
        sc.close();

    } 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 for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        } {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i] == 0) {
            	System.out.println(0);
            	return;
            } a[i] == 0 a[i] a i 0 {
            	System.out.println(0);
            	return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; BigDecimal d = new BigDecimal(a[0]); d new BigDecimal(a[0]) for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        } {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        } d = d.multiply(new BigDecimal(a[i])) d d.multiply(new BigDecimal(a[i])) d.multiply d new BigDecimal(a[i]) if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            } d.compareTo(MAX) == 1 d.compareTo(MAX) d.compareTo d MAX 1 {
            	System.out.println(-1);
            	return;                
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(d.longValue()) System.out.println System.out System System.out d.longValue() d.longValue d sc.close() sc.close sc String[] args args public class Main {

    static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        }
        BigDecimal d = new BigDecimal(a[0]);
        for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        }
        System.out.println(d.longValue());
        
        sc.close();

    }

} public class Main {

    static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        }
        BigDecimal d = new BigDecimal(a[0]);
        for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        }
        System.out.println(d.longValue());
        
        sc.close();

    }

} Main
import java.math.BigDecimal;
import java.util.*;

public class Main {

    static BigDecimal MAX = new BigDecimal(1_000_000_000_000_000_000L);
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextLong();
            if(a[i] == 0) {
            	System.out.println(0);
            	return;
            }
        }
        BigDecimal d = new BigDecimal(a[0]);
        for (int i = 1; i < n; i++) {
            d = d.multiply(new BigDecimal(a[i]));
            if(d.compareTo(MAX) == 1){
            	System.out.println(-1);
            	return;                
            }
        }
        System.out.println(d.longValue());
        
        sc.close();

    }

}
