import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long res = 1;
        boolean valid = true;
        for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        }
        System.out.println(valid ? res : -1);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long res = 1;
        boolean valid = true;
        for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        }
        System.out.println(valid ? res : -1);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long res = 1;
        boolean valid = true;
        for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        }
        System.out.println(valid ? res : -1);
    } main {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long res = 1;
        boolean valid = true;
        for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        }
        System.out.println(valid ? res : -1);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in long[] arr = new long[N]; arr new long[N] N for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            arr[i] = in.nextLong();
        } {
            arr[i] = in.nextLong();
        } arr[i] = in.nextLong() arr[i] arr i in.nextLong() in.nextLong in Arrays.sort(arr) Arrays.sort Arrays arr long res = 1; res 1 boolean valid = true; valid true for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        } {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        } if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            } 1_000_000_000_000_000_000.0 / res < arr[i] 1_000_000_000_000_000_000.0 / res 1_000_000_000_000_000_000.0 res arr[i] arr i {
                valid = false;
            } valid = false valid false res *= arr[i] res arr[i] arr i if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            } res > 1_000_000_000_000_000_000L res 1_000_000_000_000_000_000L {
                valid = false;
            } valid = false valid false System.out.println(valid ? res : -1) System.out.println System.out System System.out valid ? res : -1 valid res -1 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long res = 1;
        boolean valid = true;
        for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        }
        System.out.println(valid ? res : -1);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long res = 1;
        boolean valid = true;
        for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        }
        System.out.println(valid ? res : -1);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        long[] arr = new long[N];
        for (int i = 0; i < N; i++) {
            arr[i] = in.nextLong();
        }
        Arrays.sort(arr);
        long res = 1;
        boolean valid = true;
        for (int i = 0; i < N; i++) {
            if (1_000_000_000_000_000_000.0 / res < arr[i]) {
                valid = false;
            }
            res *= arr[i];
            if (res > 1_000_000_000_000_000_000L) {
                valid = false;
            }
        }
        System.out.println(valid ? res : -1);
    }
}