import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
import java.util.stream.LongStream;

public class Main {

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

        final long MAX = 1000000000000000000L;
        final int N = sc.nextInt();


        BigInteger[] A = new BigInteger[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }

        Arrays.sort(A, Comparator.reverseOrder());

        BigInteger ans = BigInteger.ONE;
        for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        }

        System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans);
    }
} import java.math.BigDecimal; BigDecimal java.math import java.math.BigInteger; BigInteger java.math import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util import java.util.stream.LongStream; LongStream java.util.stream public class Main {

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

        final long MAX = 1000000000000000000L;
        final int N = sc.nextInt();


        BigInteger[] A = new BigInteger[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }

        Arrays.sort(A, Comparator.reverseOrder());

        BigInteger ans = BigInteger.ONE;
        for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        }

        System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans);
    }
} Main public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);

        final long MAX = 1000000000000000000L;
        final int N = sc.nextInt();


        BigInteger[] A = new BigInteger[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }

        Arrays.sort(A, Comparator.reverseOrder());

        BigInteger ans = BigInteger.ONE;
        for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        }

        System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans);
    } main {
        final Scanner sc = new Scanner(System.in);

        final long MAX = 1000000000000000000L;
        final int N = sc.nextInt();


        BigInteger[] A = new BigInteger[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }

        Arrays.sort(A, Comparator.reverseOrder());

        BigInteger ans = BigInteger.ONE;
        for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        }

        System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final long MAX = 1000000000000000000L; MAX 1000000000000000000L final 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] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        } {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        } A[i] = sc.nextBigInteger() A[i] A i sc.nextBigInteger() sc.nextBigInteger sc if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            } A[i].compareTo(BigInteger.ZERO) == 0 A[i].compareTo(BigInteger.ZERO) A[i].compareTo A[i] A i BigInteger.ZERO BigInteger BigInteger.ZERO 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; Arrays.sort(A, Comparator.reverseOrder()) Arrays.sort Arrays A Comparator.reverseOrder() Comparator.reverseOrder Comparator BigInteger ans = BigInteger.ONE; ans BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        } {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        } if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            } ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0 ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) ans.multiply(A[i]).compareTo ans.multiply(A[i]) ans.multiply ans A[i] A i BigInteger.valueOf(MAX) BigInteger.valueOf BigInteger MAX 0 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans = ans.multiply(A[i]) ans ans.multiply(A[i]) ans.multiply ans A[i] A i System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans) System.out.println System.out System System.out ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans ans.compareTo(BigInteger.valueOf(MAX)) > 0 ans.compareTo(BigInteger.valueOf(MAX)) ans.compareTo ans BigInteger.valueOf(MAX) BigInteger.valueOf BigInteger MAX 0 -1 1 ans String[] args args public class Main {

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

        final long MAX = 1000000000000000000L;
        final int N = sc.nextInt();


        BigInteger[] A = new BigInteger[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }

        Arrays.sort(A, Comparator.reverseOrder());

        BigInteger ans = BigInteger.ONE;
        for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        }

        System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans);
    }
} public class Main {

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

        final long MAX = 1000000000000000000L;
        final int N = sc.nextInt();


        BigInteger[] A = new BigInteger[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }

        Arrays.sort(A, Comparator.reverseOrder());

        BigInteger ans = BigInteger.ONE;
        for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        }

        System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans);
    }
} Main
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
import java.util.stream.LongStream;

public class Main {

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

        final long MAX = 1000000000000000000L;
        final int N = sc.nextInt();


        BigInteger[] A = new BigInteger[N];
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextBigInteger();
            if (A[i].compareTo(BigInteger.ZERO) == 0) {
                System.out.println(0);
                return;
            }
        }

        Arrays.sort(A, Comparator.reverseOrder());

        BigInteger ans = BigInteger.ONE;
        for (int i = 0; i < N; i++) {
            if (ans.multiply(A[i]).compareTo(BigInteger.valueOf(MAX)) > 0) {
                System.out.println(-1);
                return;
            }
            ans = ans.multiply(A[i]);
        }

        System.out.println(ans.compareTo(BigInteger.valueOf(MAX)) > 0 ? -1 : ans);
    }
}
