import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] nums = new long[N]; nums new long[N] N for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            nums[i]=sc.nextLong();
        } {
            nums[i]=sc.nextLong();
        } nums[i]=sc.nextLong() nums[i] nums i sc.nextLong() sc.nextLong sc long border=1000000000000000000l; border 1000000000000000000l long result=1l; result 1l for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        } {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        } if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            } nums[i]==0 nums[i] nums i 0 {
                System.out.println(0);
                System.exit(0);
            } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        } {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        } if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            } result>border/nums[i] result border/nums[i] border nums[i] nums i {
                System.out.println(-1);
                System.exit(0);
            } System.out.println(-1) System.out.println System.out System System.out -1 1 System.exit(0) System.exit System 0 {
                result*=nums[i];
            } result*=nums[i] result nums[i] nums i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] nums = new long[N];
        for(int i=0;i<N;i++) {
            nums[i]=sc.nextLong();
        }
        long border=1000000000000000000l;
        long result=1l;
        for(int i=0;i<N;i++) {
            if(nums[i]==0) {
                System.out.println(0);
                System.exit(0);
            }
        }
        for(int i=0;i<N;i++) {
            if(result>border/nums[i]) {
                System.out.println(-1);
                System.exit(0);
            }else {
                result*=nums[i];
            }
        }
        System.out.println(result);
    }
}
