import java.util.Scanner;
import java.util.Arrays;
public class Main{
        public static void main(String[] args){
                final Scanner cin = new Scanner(System.in);
                int n = cin.nextInt();
                long[] arr=new long[n];
                for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                }   
                Arrays.parallelSort(arr);
                if(arr[0]==0){
                        System.out.print(0);
                        return;
                }   
                long mul=1L;
                for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                }   
                System.out.print(mul>(long)1e18?-1:mul);
        }   
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util public class Main{
        public static void main(String[] args){
                final Scanner cin = new Scanner(System.in);
                int n = cin.nextInt();
                long[] arr=new long[n];
                for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                }   
                Arrays.parallelSort(arr);
                if(arr[0]==0){
                        System.out.print(0);
                        return;
                }   
                long mul=1L;
                for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                }   
                System.out.print(mul>(long)1e18?-1:mul);
        }   
} Main public static void main(String[] args){
                final Scanner cin = new Scanner(System.in);
                int n = cin.nextInt();
                long[] arr=new long[n];
                for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                }   
                Arrays.parallelSort(arr);
                if(arr[0]==0){
                        System.out.print(0);
                        return;
                }   
                long mul=1L;
                for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                }   
                System.out.print(mul>(long)1e18?-1:mul);
        } main {
                final Scanner cin = new Scanner(System.in);
                int n = cin.nextInt();
                long[] arr=new long[n];
                for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                }   
                Arrays.parallelSort(arr);
                if(arr[0]==0){
                        System.out.print(0);
                        return;
                }   
                long mul=1L;
                for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                }   
                System.out.print(mul>(long)1e18?-1:mul);
        } final Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int n = cin.nextInt(); n cin.nextInt() cin.nextInt cin long[] arr=new long[n]; arr new long[n] n for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                } int i=0; int i=0; i 0 i<n i n i++ i++ i {
                        arr[i]=cin.nextLong();
                } {
                        arr[i]=cin.nextLong();
                } arr[i]=cin.nextLong() arr[i] arr i cin.nextLong() cin.nextLong cin Arrays.parallelSort(arr) Arrays.parallelSort Arrays arr if(arr[0]==0){
                        System.out.print(0);
                        return;
                } arr[0]==0 arr[0] arr 0 0 {
                        System.out.print(0);
                        return;
                } System.out.print(0) System.out.print System.out System System.out 0 return; long mul=1L; mul 1L for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                } long a arr {
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                } {
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                } if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        } mul*1.0*a>(long)1e18 mul*1.0*a mul*1.0*a mul 1.0 a (long)1e18 {
                                System.out.print(-1);
                                System.exit(0);
                        } System.out.print(-1) System.out.print System.out System System.out -1 1 System.exit(0) System.exit System 0 mul=mul*a mul mul*a mul a System.out.print(mul>(long)1e18?-1:mul) System.out.print System.out System System.out mul>(long)1e18?-1:mul mul>(long)1e18 mul (long)1e18 -1 1 mul String[] args args public class Main{
        public static void main(String[] args){
                final Scanner cin = new Scanner(System.in);
                int n = cin.nextInt();
                long[] arr=new long[n];
                for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                }   
                Arrays.parallelSort(arr);
                if(arr[0]==0){
                        System.out.print(0);
                        return;
                }   
                long mul=1L;
                for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                }   
                System.out.print(mul>(long)1e18?-1:mul);
        }   
} public class Main{
        public static void main(String[] args){
                final Scanner cin = new Scanner(System.in);
                int n = cin.nextInt();
                long[] arr=new long[n];
                for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                }   
                Arrays.parallelSort(arr);
                if(arr[0]==0){
                        System.out.print(0);
                        return;
                }   
                long mul=1L;
                for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                }   
                System.out.print(mul>(long)1e18?-1:mul);
        }   
} Main
import java.util.Scanner;
import java.util.Arrays;
public class Main{
        public static void main(String[] args){
                final Scanner cin = new Scanner(System.in);
                int n = cin.nextInt();
                long[] arr=new long[n];
                for(int i=0;i<n;i++){
                        arr[i]=cin.nextLong();
                }   
                Arrays.parallelSort(arr);
                if(arr[0]==0){
                        System.out.print(0);
                        return;
                }   
                long mul=1L;
                for(long a:arr){
                        if(mul*1.0*a>(long)1e18){
                                System.out.print(-1);
                                System.exit(0);
                        }   
                        mul=mul*a;
                }   
                System.out.print(mul>(long)1e18?-1:mul);
        }   
}