import java.math.BigInteger;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<BigInteger> list = new ArrayList<>();
        BigInteger zero = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        }

        BigInteger a, b, c;
        a = new BigInteger("1");
        c = new BigInteger("1000000000000000000");

        for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(a);
    }
} import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<BigInteger> list = new ArrayList<>();
        BigInteger zero = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        }

        BigInteger a, b, c;
        a = new BigInteger("1");
        c = new BigInteger("1000000000000000000");

        for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(a);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<BigInteger> list = new ArrayList<>();
        BigInteger zero = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        }

        BigInteger a, b, c;
        a = new BigInteger("1");
        c = new BigInteger("1000000000000000000");

        for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(a);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<BigInteger> list = new ArrayList<>();
        BigInteger zero = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        }

        BigInteger a, b, c;
        a = new BigInteger("1");
        c = new BigInteger("1000000000000000000");

        for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(a);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc List<BigInteger> list = new ArrayList<>(); list new ArrayList<>() BigInteger zero = new BigInteger("0"); zero new BigInteger("0") for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        } {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        } BigInteger bi = sc.nextBigInteger(); bi sc.nextBigInteger() sc.nextBigInteger sc if (bi.equals(zero)) {
                System.out.println(0);
                return;
            } bi.equals(zero) bi.equals bi zero {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; list.add(bi) list.add list bi BigInteger a a b b c; c a = new BigInteger("1") a new BigInteger("1") c = new BigInteger("1000000000000000000") c new BigInteger("1000000000000000000") for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        } {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        } b = list.get(i) b list.get(i) list.get list i a = a.multiply(b) a a.multiply(b) a.multiply a b if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            } a.compareTo(c) > 0 a.compareTo(c) a.compareTo a c 0 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<BigInteger> list = new ArrayList<>();
        BigInteger zero = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        }

        BigInteger a, b, c;
        a = new BigInteger("1");
        c = new BigInteger("1000000000000000000");

        for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(a);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<BigInteger> list = new ArrayList<>();
        BigInteger zero = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        }

        BigInteger a, b, c;
        a = new BigInteger("1");
        c = new BigInteger("1000000000000000000");

        for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(a);
    }
} Main
import java.math.BigInteger;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<BigInteger> list = new ArrayList<>();
        BigInteger zero = new BigInteger("0");
        for (int i = 0; i < n; i++) {
            BigInteger bi = sc.nextBigInteger();
            if (bi.equals(zero)) {
                System.out.println(0);
                return;
            }
            list.add(bi);
        }

        BigInteger a, b, c;
        a = new BigInteger("1");
        c = new BigInteger("1000000000000000000");

        for (int i = 0; i < n; i++) {
            b = list.get(i);
            a = a.multiply(b);
            if (a.compareTo(c) > 0) {
                System.out.println(-1);
                return;
            }
        }
        System.out.println(a);
    }
}
