import java.util.*; 
import java.io.*;

public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
        long[] input = new long[N];

        for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        }

        long ans =input[0];

        for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        }

        System.out.println(ans);
 
    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
        long[] input = new long[N];

        for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        }

        long ans =input[0];

        for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        }

        System.out.println(ans);
 
    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
} Main static StringTokenizer st; st static BufferedReader br; br static PrintWriter out; out public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
        long[] input = new long[N];

        for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        }

        long ans =input[0];

        for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        }

        System.out.println(ans);
 
    } main {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
        long[] input = new long[N];

        for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        }

        long ans =input[0];

        for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        }

        System.out.println(ans);
 
    } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) int N = nextInt(); N nextInt() nextInt long[] input = new long[N]; input new long[N] N for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        } {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        } input[i] = nextLong() input[i] input i nextLong() nextLong if(input[i]==0) {
                System.out.println(0);
                return;
            } input[i]==0 input[i] input i 0 {
                System.out.println(0);
                return;
            } System.out.println(0) System.out.println System.out System System.out 0 return; long ans =input[0]; ans input[0] input 0 for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        } int i=1; int i=1; i 1 i<N i N i++ i++ i {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        } {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        } if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            } (ans > (long)(1e18)/ input[i]) ans (long)(1e18)/ input[i] (long)(1e18) input[i] input i { 
                System.out.println(-1);
                return;
            } System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans = ans * input[i] ans ans * input[i] ans input[i] input i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    } nextInt {
        return Integer.parseInt(next());
    } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public static long nextLong() throws IOException {
        return Long.parseLong(next());
    } nextLong {
        return Long.parseLong(next());
    } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    } nextDouble {
        return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    } next {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    } while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim()); st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st = new StringTokenizer(br.readLine().trim()) st new StringTokenizer(br.readLine().trim()) return st.nextToken(); st.nextToken() st.nextToken st public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
        long[] input = new long[N];

        for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        }

        long ans =input[0];

        for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        }

        System.out.println(ans);
 
    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
} public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
        long[] input = new long[N];

        for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        }

        long ans =input[0];

        for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        }

        System.out.println(ans);
 
    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
} Main
import java.util.*; 
import java.io.*;

public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int N = nextInt();
        long[] input = new long[N];

        for (int i=0; i<N; i++) {
            input[i] = nextLong();
            if(input[i]==0) {
                System.out.println(0);
                return;
            }
        }

        long ans =input[0];

        for (int i=1; i<N; i++) {
            // If you directly perform multiplication on 64-bit integers, it causes overflow
            // if((Math.log10(ans) + Math.log10(input[i]) >= 18) && ans * input[i] != 1e18){
            //if(ans> 1e18/ input[i]){ 
            // > not working, need use <=, because 1e18/ input[i] will lose 0.000001
            if((ans > (long)(1e18)/ input[i])){ 
                System.out.println(-1);
                return;
            }
            ans = ans * input[i];
        }

        System.out.println(ans);
 
    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
}
