import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long currentA = 1;
        long[] vals = new long[N];
        for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        }
        Arrays.sort(vals);
        if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        }

    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long currentA = 1;
        long[] vals = new long[N];
        for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        }
        Arrays.sort(vals);
        if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        }

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long currentA = 1;
        long[] vals = new long[N];
        for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        }
        Arrays.sort(vals);
        if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long currentA = 1;
        long[] vals = new long[N];
        for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        }
        Arrays.sort(vals);
        if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long currentA = 1; currentA 1 long[] vals = new long[N]; vals new long[N] N for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            vals[i] = sc.nextLong();
        } {
            vals[i] = sc.nextLong();
        } vals[i] = sc.nextLong() vals[i] vals i sc.nextLong() sc.nextLong sc Arrays.sort(vals) Arrays.sort Arrays vals if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        } vals[0] == 0 vals[0] vals 0 0 {
            System.out.println(0);
        } System.out.println(0) System.out.println System.out System System.out 0 {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        } for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            } {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            } if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                } currentA > 1000000000000000000L / vals[i] currentA 1000000000000000000L / vals[i] 1000000000000000000L vals[i] vals i {
                    currentA = -1;
                    break;
                } currentA = -1 currentA -1 1 break; currentA *= vals[i] currentA vals[i] vals i System.out.println(currentA) System.out.println System.out System System.out currentA String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long currentA = 1;
        long[] vals = new long[N];
        for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        }
        Arrays.sort(vals);
        if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        }

    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long currentA = 1;
        long[] vals = new long[N];
        for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        }
        Arrays.sort(vals);
        if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        }

    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long currentA = 1;
        long[] vals = new long[N];
        for (int i = 0; i < N; i++) {
            vals[i] = sc.nextLong();
        }
        Arrays.sort(vals);
        if (vals[0] == 0) {
            System.out.println(0);
        } else {
            for (int i = 0; i < N; i++) {
                if (currentA > 1000000000000000000L / vals[i]) {
                    currentA = -1;
                    break;
                }
                currentA *= vals[i];
            }
            System.out.println(currentA);
        }

    }
}
