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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigInteger[] a = new BigInteger[n];
        BigInteger aa = new BigInteger("1000000000000000000");
        BigInteger sum = new BigInteger("1");
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        }
        if(flg) {
            System.out.println(0);
            return;
        }
        for (int i = 0; i < n; i++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(sum);
    }
} 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 n = sc.nextInt();
        BigInteger[] a = new BigInteger[n];
        BigInteger aa = new BigInteger("1000000000000000000");
        BigInteger sum = new BigInteger("1");
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        }
        if(flg) {
            System.out.println(0);
            return;
        }
        for (int i = 0; i < n; i++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigInteger[] a = new BigInteger[n];
        BigInteger aa = new BigInteger("1000000000000000000");
        BigInteger sum = new BigInteger("1");
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        }
        if(flg) {
            System.out.println(0);
            return;
        }
        for (int i = 0; i < n; i++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigInteger[] a = new BigInteger[n];
        BigInteger aa = new BigInteger("1000000000000000000");
        BigInteger sum = new BigInteger("1");
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        }
        if(flg) {
            System.out.println(0);
            return;
        }
        for (int i = 0; i < n; i++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(sum);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc BigInteger[] a = new BigInteger[n]; a new BigInteger[n] n BigInteger aa = new BigInteger("1000000000000000000"); aa new BigInteger("1000000000000000000") BigInteger sum = new BigInteger("1"); sum new BigInteger("1") boolean flg = false; flg false for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        } {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        } a[i] = sc.nextBigInteger() a[i] a i sc.nextBigInteger() sc.nextBigInteger sc if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            } a[i].equals(BigInteger.ZERO) a[i].equals a[i] a i BigInteger.ZERO BigInteger BigInteger.ZERO {
                flg = true;
            } flg = true flg true if(flg) {
            System.out.println(0);
            return;
        } flg {
            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++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        } {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        } sum = sum.multiply(a[i]) sum sum.multiply(a[i]) sum.multiply sum a[i] a i if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            } sum.compareTo(aa) > 0 sum.compareTo(aa) sum.compareTo sum aa 0 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigInteger[] a = new BigInteger[n];
        BigInteger aa = new BigInteger("1000000000000000000");
        BigInteger sum = new BigInteger("1");
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        }
        if(flg) {
            System.out.println(0);
            return;
        }
        for (int i = 0; i < n; i++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(sum);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigInteger[] a = new BigInteger[n];
        BigInteger aa = new BigInteger("1000000000000000000");
        BigInteger sum = new BigInteger("1");
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        }
        if(flg) {
            System.out.println(0);
            return;
        }
        for (int i = 0; i < n; i++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(sum);
    }
} 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 n = sc.nextInt();
        BigInteger[] a = new BigInteger[n];
        BigInteger aa = new BigInteger("1000000000000000000");
        BigInteger sum = new BigInteger("1");
        boolean flg = false;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextBigInteger();
            if(a[i].equals(BigInteger.ZERO)) {
                flg = true;
            }
        }
        if(flg) {
            System.out.println(0);
            return;
        }
        for (int i = 0; i < n; i++) {
            sum = sum.multiply(a[i]);
            if(sum.compareTo(aa) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(sum);
    }
}