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];

        for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        }

        BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18));
        BigInteger res = BigInteger.ONE;

        for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        }

        System.out.println(res);

    }
} 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];

        for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        }

        BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18));
        BigInteger res = BigInteger.ONE;

        for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        }

        System.out.println(res);

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        BigInteger[] A = new BigInteger[N];

        for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        }

        BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18));
        BigInteger res = BigInteger.ONE;

        for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        }

        System.out.println(res);

    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        BigInteger[] A = new BigInteger[N];

        for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        }

        BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18));
        BigInteger res = BigInteger.ONE;

        for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        }

        System.out.println(res);

    } 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 for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        } {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        } A[i] = BigInteger.valueOf(sc.nextLong()) A[i] A i BigInteger.valueOf(sc.nextLong()) BigInteger.valueOf BigInteger sc.nextLong() sc.nextLong sc if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            } A[i].equals(BigInteger.ZERO) A[i].equals A[i] A i BigInteger.ZERO BigInteger BigInteger.ZERO {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18)); max BigInteger.valueOf((long) Math.pow(10, 18)) BigInteger.valueOf BigInteger (long) Math.pow(10, 18) Math.pow Math 10 18 BigInteger res = BigInteger.ONE; res BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        } {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        } if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            } res.multiply(A[i]).compareTo(max) == 1 res.multiply(A[i]).compareTo(max) res.multiply(A[i]).compareTo res.multiply(A[i]) res.multiply res A[i] A i max 1 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; res = res.multiply(A[i]) res res.multiply(A[i]) res.multiply res A[i] A i System.out.println(res) System.out.println System.out System System.out res 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];

        for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        }

        BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18));
        BigInteger res = BigInteger.ONE;

        for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        }

        System.out.println(res);

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        BigInteger[] A = new BigInteger[N];

        for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        }

        BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18));
        BigInteger res = BigInteger.ONE;

        for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        }

        System.out.println(res);

    }
} 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];

        for (int i = 0; i < N; i++) {
            A[i] = BigInteger.valueOf(sc.nextLong());

            if (A[i].equals(BigInteger.ZERO)) {
                System.out.println(0);
                return;
            }
        }

        BigInteger max = BigInteger.valueOf((long) Math.pow(10, 18));
        BigInteger res = BigInteger.ONE;

        for (int i = 0; i < N; i++) {
            if (res.multiply(A[i]).compareTo(max) == 1){
                System.out.println(-1);
                return;
            }

            res = res.multiply(A[i]);
        }

        System.out.println(res);

    }
}
