import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long[] b = new long[a];
        long total = 1;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        }
        long c = (long) Math.pow(10, 18);
        for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        }
        System.out.println(total);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long[] b = new long[a];
        long total = 1;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        }
        long c = (long) Math.pow(10, 18);
        for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        }
        System.out.println(total);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long[] b = new long[a];
        long total = 1;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        }
        long c = (long) Math.pow(10, 18);
        for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        }
        System.out.println(total);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long[] b = new long[a];
        long total = 1;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        }
        long c = (long) Math.pow(10, 18);
        for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        }
        System.out.println(total);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc long[] b = new long[a]; b new long[a] a long total = 1; total 1 for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        } int i =0; int i =0; i 0 i<a i a i++ i++ i {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        } {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        } b[i] = sc.nextLong() b[i] b i sc.nextLong() sc.nextLong sc if(b[i] == 0) {
                System.out.println("0");
                return;
            } b[i] == 0 b[i] b i 0 {
                System.out.println("0");
                return;
            } System.out.println("0") System.out.println System.out System System.out "0" return; long c = (long) Math.pow(10, 18); c (long) Math.pow(10, 18) Math.pow Math 10 18 for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        } int i =0; int i =0; i 0 i<a i a i++ i++ i {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        } {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        } if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            } b[i] > c/total b[i] b i c/total c total {
                System.out.println("-1");
                return;
            } System.out.println("-1") System.out.println System.out System System.out "-1" return; total *= b[i] total b[i] b i System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long[] b = new long[a];
        long total = 1;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        }
        long c = (long) Math.pow(10, 18);
        for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        }
        System.out.println(total);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long[] b = new long[a];
        long total = 1;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        }
        long c = (long) Math.pow(10, 18);
        for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        }
        System.out.println(total);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        long[] b = new long[a];
        long total = 1;
        for(int i =0; i<a; i++) {
            b[i] = sc.nextLong();
            if(b[i] == 0) {
                System.out.println("0");
                return;
            }
        }
        long c = (long) Math.pow(10, 18);
        for(int i =0; i<a; i++) {
            if(b[i] > c/total ) {
                System.out.println("-1");
                return;
            }
            total *= b[i];
        }
        System.out.println(total);
    }
}