import java.util.Scanner;
    
class Main {    
    public static void main(String[] args) { 
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),zero=0;
        long[] arr = new long[n];
        long ans = 1;
        for(int i=0;i<n;++i) {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        }
        if(zero==1) {
            System.out.println("0");
            return ;
        }
        
        for(int i=0;i<n;++i) {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util class Main {    
    public static void main(String[] args) { 
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),zero=0;
        long[] arr = new long[n];
        long ans = 1;
        for(int i=0;i<n;++i) {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        }
        if(zero==1) {
            System.out.println("0");
            return ;
        }
        
        for(int i=0;i<n;++i) {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) { 
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),zero=0;
        long[] arr = new long[n];
        long ans = 1;
        for(int i=0;i<n;++i) {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        }
        if(zero==1) {
            System.out.println("0");
            return ;
        }
        
        for(int i=0;i<n;++i) {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(ans);
    } main { 
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),zero=0;
        long[] arr = new long[n];
        long ans = 1;
        for(int i=0;i<n;++i) {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        }
        if(zero==1) {
            System.out.println("0");
            return ;
        }
        
        for(int i=0;i<n;++i) {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(ans);
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt() n in.nextInt() in.nextInt in zero=0; zero 0 long[] arr = new long[n]; arr new long[n] n long ans = 1; ans 1 for(int i=0;i<n;++i) {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        } int i=0; int i=0; i 0 i<n i n ++i ++i i {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        } {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        } arr[i] = in.nextLong() arr[i] arr i in.nextLong() in.nextLong in if(arr[i]==0) zero=1; arr[i]==0 arr[i] arr i 0 zero=1 zero 1 if(zero==1) {
            System.out.println("0");
            return ;
        } zero==1 zero 1 {
            System.out.println("0");
            return ;
        } System.out.println("0") System.out.println System.out System System.out "0" return ; for(int i=0;i<n;++i) {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        } int i=0; int i=0; i 0 i<n i n ++i ++i i {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        } {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        } if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            } ans <= 1000000000000000000L/arr[i] ans 1000000000000000000L/arr[i] 1000000000000000000L arr[i] arr i ans = ans*arr[i] ans ans*arr[i] ans arr[i] arr i {
                System.out.println("-1");
                return;
            } System.out.println("-1") System.out.println System.out System System.out "-1" return; System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.Scanner;
    
class Main {    
    public static void main(String[] args) { 
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(),zero=0;
        long[] arr = new long[n];
        long ans = 1;
        for(int i=0;i<n;++i) {
            arr[i] = in.nextLong();
            if(arr[i]==0) zero=1;
        }
        if(zero==1) {
            System.out.println("0");
            return ;
        }
        
        for(int i=0;i<n;++i) {
            if(ans <= 1000000000000000000L/arr[i]) ans = ans*arr[i];
            else {
                System.out.println("-1");
                return;
            }
        }
        System.out.println(ans);
    }
}