import java.util.*;
public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        long z = (long)1e18;
        
        Arrays.sort(a);
        long ans = 1;
        for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        }
        
        
        System.out.println(ans);
    }
} import java.util.*; util.* java public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        long z = (long)1e18;
        
        Arrays.sort(a);
        long ans = 1;
        for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        }
        
        
        System.out.println(ans);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        long z = (long)1e18;
        
        Arrays.sort(a);
        long ans = 1;
        for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        }
        
        
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        long z = (long)1e18;
        
        Arrays.sort(a);
        long ans = 1;
        for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        }
        
        
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long[] a = new long[n]; a new long[n] n for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            a[i] = Long.parseLong(sc.next());
        } {
            a[i] = Long.parseLong(sc.next());
        } a[i] = Long.parseLong(sc.next()) a[i] a i Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc long z = (long)1e18; z (long)1e18 Arrays.sort(a) Arrays.sort Arrays a long ans = 1; ans 1 for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        } {
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        } if(a[i]==0){
                System.out.println(0);
                return;
            } a[i]==0 a[i] a i 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; if(z/a[i]<ans){
                System.out.println(-1);
                return;
            } z/a[i]<ans z/a[i] z a[i] a i ans {
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans *= a[i] ans a[i] a i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        long z = (long)1e18;
        
        Arrays.sort(a);
        long ans = 1;
        for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        }
        
        
        System.out.println(ans);
    }
} public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        long z = (long)1e18;
        
        Arrays.sort(a);
        long ans = 1;
        for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        }
        
        
        System.out.println(ans);
    }
} Main
import java.util.*;
public class Main{
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        long[] a = new long[n];
        for(int i=0; i<n; i++){
            a[i] = Long.parseLong(sc.next());
        }
        
        long z = (long)1e18;
        
        Arrays.sort(a);
        long ans = 1;
        for(int i=0; i<n; i++){
            if(a[i]==0){
                System.out.println(0);
                return;
            }
            if(z/a[i]<ans){
                System.out.println(-1);
                return;
            }
            ans *= a[i];
        }
        
        
        System.out.println(ans);
    }
}