import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(total);
    }
} import java.math.BigInteger; BigInteger 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 a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(total);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(total);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc BigInteger[] b = new BigInteger[a]; b new BigInteger[a] a BigInteger total = BigInteger.ONE; total BigInteger.ONE BigInteger BigInteger.ONE for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        } int i =0; int i =0; i 0 i<a i a i++ i++ i {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        } {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        } b[i] = sc.nextBigInteger() b[i] b i sc.nextBigInteger() sc.nextBigInteger sc if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            } BigInteger.ZERO.equals(b[i]) BigInteger.ZERO.equals BigInteger.ZERO BigInteger BigInteger.ZERO b[i] b i {
                System.out.println("0");
                return;
            } System.out.println("0") System.out.println System.out System System.out "0" return; BigInteger c = BigInteger.TEN.pow(18); c BigInteger.TEN.pow(18) BigInteger.TEN.pow BigInteger.TEN BigInteger BigInteger.TEN 18 for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        } int i =0; int i =0; i 0 i<a i a i++ i++ i {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        } {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        } total = b[i].multiply(total) total b[i].multiply(total) b[i].multiply b[i] b i total if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            } 0 < total.compareTo(c) 0 total.compareTo(c) total.compareTo total c {
                System.out.println("-1");
                return;
            } System.out.println("-1") System.out.println System.out System System.out "-1" return; System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(total);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(total);
    }
} Main
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        BigInteger[] b = new BigInteger[a];
        BigInteger total = BigInteger.ONE;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextBigInteger();
            if(BigInteger.ZERO.equals(b[i])) {
                System.out.println("0");
                return;
            }
        }
        BigInteger c = BigInteger.TEN.pow(18);
        for(int i =0; i<a; i++) {
            total = b[i].multiply(total);
            if(0 < total.compareTo(c) ) {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(total);
    }
}