import java.util.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        System.out.println(ans);
    }
} import java.util.*; util.* java import java.math.*; math.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] A = new long[N]; A new long[N] N for (int i = 0; i < N ;i++) {
            A[i] = sc.nextLong();
            if (A[i] == 0) {
                System.out.println(0);
                return;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A[i] = sc.nextLong();
            if (A[i] == 0) {
                System.out.println(0);
                return;
            }
        } {
            A[i] = sc.nextLong();
            if (A[i] == 0) {
                System.out.println(0);
                return;
            }
        } A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc if (A[i] == 0) {
                System.out.println(0);
                return;
            } A[i] == 0 A[i] A i 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; BigInteger ans = BigInteger.ONE; ans BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < N ;i++) {
            ans = ans.multiply(BigInteger.valueOf(A[i]));
            if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {
                System.out.println(-1);
                return;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            ans = ans.multiply(BigInteger.valueOf(A[i]));
            if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {
                System.out.println(-1);
                return;
            }
        } {
            ans = ans.multiply(BigInteger.valueOf(A[i]));
            if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {
                System.out.println(-1);
                return;
            }
        } ans = ans.multiply(BigInteger.valueOf(A[i])) ans ans.multiply(BigInteger.valueOf(A[i])) ans.multiply ans BigInteger.valueOf(A[i]) BigInteger.valueOf BigInteger A[i] A i if (BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1) {
                System.out.println(-1);
                return;
            } BigInteger.valueOf(1000000000000000000L).compareTo(ans) == -1 BigInteger.valueOf(1000000000000000000L).compareTo(ans) BigInteger.valueOf(1000000000000000000L).compareTo BigInteger.valueOf(1000000000000000000L) BigInteger.valueOf BigInteger 1000000000000000000L ans -1 1 {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        System.out.println(ans);
    }
} Main
import java.util.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        System.out.println(ans);
    }
}