import java.util.*;
import java.math.*;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        long ans = 1;
        long[] s = new long[n];
        for(int i =0;i<n;i++){
            s[i]=Long.parseLong(sc.next());
        }
        Arrays.sort(s);
        for(int i = 0;i<n;i++){
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[i];
        }
        System.out.println(ans);
    }
} import java.util.*; util.* java import java.math.*; math.* java class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        long ans = 1;
        long[] s = new long[n];
        for(int i =0;i<n;i++){
            s[i]=Long.parseLong(sc.next());
        }
        Arrays.sort(s);
        for(int i = 0;i<n;i++){
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[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 ans = 1;
        long[] s = new long[n];
        for(int i =0;i<n;i++){
            s[i]=Long.parseLong(sc.next());
        }
        Arrays.sort(s);
        for(int i = 0;i<n;i++){
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[i];
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        long ans = 1;
        long[] s = new long[n];
        for(int i =0;i<n;i++){
            s[i]=Long.parseLong(sc.next());
        }
        Arrays.sort(s);
        for(int i = 0;i<n;i++){
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[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 ans = 1; ans 1 long[] s = new long[n]; s new long[n] n for(int i =0;i<n;i++){
            s[i]=Long.parseLong(sc.next());
        } int i =0; int i =0; i 0 i<n i n i++ i++ i {
            s[i]=Long.parseLong(sc.next());
        } {
            s[i]=Long.parseLong(sc.next());
        } s[i]=Long.parseLong(sc.next()) s[i] s i Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s for(int i = 0;i<n;i++){
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[i];
        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[i];
        } {
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[i];
        } if(s[i]==0){
                ans = 0;
                break;
            } s[i]==0 s[i] s i 0 {
                ans = 0;
                break;
            } ans = 0 ans 0 break; if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            } Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L Math.log10(s[i])+Math.log10(ans)>18 Math.log10(s[i])+Math.log10(ans) Math.log10(s[i]) Math.log10 Math s[i] s i Math.log10(ans) Math.log10 Math ans 18 ans*s[i]>1000000000000000000L ans*s[i] ans s[i] s i 1000000000000000000L {
                ans = -1;
                break;
            } ans = -1 ans -1 1 break; ans*=s[i] ans s[i] s i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;
import java.math.*;
class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        long ans = 1;
        long[] s = new long[n];
        for(int i =0;i<n;i++){
            s[i]=Long.parseLong(sc.next());
        }
        Arrays.sort(s);
        for(int i = 0;i<n;i++){
            if(s[i]==0){
                ans = 0;
                break;
            }
            if(Math.log10(s[i])+Math.log10(ans)>18||ans*s[i]>1000000000000000000L){
                ans = -1;
                break;
            }
            ans*=s[i];
        }
        System.out.println(ans);
    }
}