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

public class Main{

    public static void main(String[] args) throws IOException {
        int N = in.nextInt();
        long A[] = new long[N];
        boolean zero = false;
        for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        }
        
        if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        }
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static int[] readInt(int N) throws IOException { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    }
    
    static long[] readLong(int N) throws IOException { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    }
    
    static String[] readString(int N) throws IOException { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    }
    
    static void debug(Object ... O) { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    }
}

class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { 
        return Integer.parseInt(next()); 
    }
    
    double nextDouble() throws IOException { 
        return Double.parseDouble(next());
    }
    
    long nextLong() throws IOException { 
        return Long.parseLong(next()); 
    }
    
    String nextLine() throws IOException { 
        return reader.readLine(); 
    }
    
    void close() throws IOException { 
        reader.close(); 
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main{

    public static void main(String[] args) throws IOException {
        int N = in.nextInt();
        long A[] = new long[N];
        boolean zero = false;
        for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        }
        
        if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        }
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static int[] readInt(int N) throws IOException { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    }
    
    static long[] readLong(int N) throws IOException { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    }
    
    static String[] readString(int N) throws IOException { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    }
    
    static void debug(Object ... O) { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    }
} Main static int MIN = Integer.MIN_VALUE; MIN Integer.MIN_VALUE Integer Integer.MIN_VALUE static int MAX = Integer.MAX_VALUE; MAX Integer.MAX_VALUE Integer Integer.MAX_VALUE static Reader in = new Reader(); in new Reader() static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args) throws IOException {
        int N = in.nextInt();
        long A[] = new long[N];
        boolean zero = false;
        for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        }
        
        if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        }
        in.close();
        out.close();
    } main {
        int N = in.nextInt();
        long A[] = new long[N];
        boolean zero = false;
        for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        }
        
        if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        }
        in.close();
        out.close();
    } int N = in.nextInt(); N in.nextInt() in.nextInt in long A[] = new long[N]; A new long[N] N boolean zero = false; zero false for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        } {
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        } A[i] = in.nextLong() A[i] A i in.nextLong() in.nextLong in if(A[i] == 0){
                zero = true;
            } A[i] == 0 A[i] A i 0 {
                zero = true;
            } zero = true zero true if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        } zero {
            println(0);
        } println(0) println 0 {
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        } long limit = (long) 1e18; limit (long) 1e18 long res = 1; res 1 for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            } long a A {
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            } {
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            } if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                } a <= limit/res a limit/res limit res {
                    res = res * a;
                } res = res * a res res * a res a {
                    res = -1;
                    break;
                } res = -1 res -1 1 break; println(res) println res in.close() in.close in out.close() out.close out String[] args args static int[] readInt(int N) throws IOException { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    } readInt { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    } int arr[] = new int[N]; arr new int[N] N for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i { 
    		arr[i] = in.nextInt(); 
    	} { 
    		arr[i] = in.nextInt(); 
    	} arr[i] = in.nextInt() arr[i] arr i in.nextInt() in.nextInt in return arr; arr int N N static long[] readLong(int N) throws IOException { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    } readLong { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    } long arr[] = new long[N]; arr new long[N] N for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i { 
    		arr[i] = in.nextLong(); 
    	} { 
    		arr[i] = in.nextLong(); 
    	} arr[i] = in.nextLong() arr[i] arr i in.nextLong() in.nextLong in return arr; arr int N N static String[] readString(int N) throws IOException { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    } readString { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    } String arr[] = new String[N]; arr new String[N] N for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} int i = 0; int i = 0; i 0 i < N i N i++ i++ i { 
    		arr[i] = in.next(); 
    	} { 
    		arr[i] = in.next(); 
    	} arr[i] = in.next() arr[i] arr i in.next() in.next in return arr; arr int N N static void print(Object O) {  
    	out.print(O); 
    } print {  
    	out.print(O); 
    } out.print(O) out.print out O Object O O static void println(Object O) { 
    	out.println(O); 
    } println { 
    	out.println(O); 
    } out.println(O) out.println out O Object O O static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    } println { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    } for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} int i = 0; int i = 0; i 0 i < arr.length i arr.length arr arr.length i++ i++ i { 
    		print(arr[i] + " "); 
    	} { 
    		print(arr[i] + " "); 
    	} print(arr[i] + " ") print arr[i] + " " arr[i] arr i " " println("") println "" int arr[] arr static void debug(Object ... O) { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    } debug { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    } for(Object obj: O){
    		System.out.print(obj + " ");
    	} Object obj O {
    		System.out.print(obj + " ");
    	} {
    		System.out.print(obj + " ");
    	} System.out.print(obj + " ") System.out.print System.out System System.out obj + " " obj " " System.out.println() System.out.println System.out System System.out Object ... O O class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { 
        return Integer.parseInt(next()); 
    }
    
    double nextDouble() throws IOException { 
        return Double.parseDouble(next());
    }
    
    long nextLong() throws IOException { 
        return Long.parseLong(next()); 
    }
    
    String nextLine() throws IOException { 
        return reader.readLine(); 
    }
    
    void close() throws IOException { 
        reader.close(); 
    }
} Reader BufferedReader reader; reader StringTokenizer tokenizer; tokenizer Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    } Reader {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    } reader = new BufferedReader(new InputStreamReader(System.in)) reader new BufferedReader(new InputStreamReader(System.in)) tokenizer = new StringTokenizer("") tokenizer new StringTokenizer("") String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    } next {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    } while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        } !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer 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 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 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 String nextLine() throws IOException { 
        return reader.readLine(); 
    } nextLine { 
        return reader.readLine(); 
    } return reader.readLine(); reader.readLine() reader.readLine reader void close() throws IOException { 
        reader.close(); 
    } close { 
        reader.close(); 
    } reader.close() reader.close reader public class Main{

    public static void main(String[] args) throws IOException {
        int N = in.nextInt();
        long A[] = new long[N];
        boolean zero = false;
        for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        }
        
        if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        }
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static int[] readInt(int N) throws IOException { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    }
    
    static long[] readLong(int N) throws IOException { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    }
    
    static String[] readString(int N) throws IOException { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    }
    
    static void debug(Object ... O) { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    }
} public class Main{

    public static void main(String[] args) throws IOException {
        int N = in.nextInt();
        long A[] = new long[N];
        boolean zero = false;
        for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        }
        
        if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        }
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static int[] readInt(int N) throws IOException { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    }
    
    static long[] readLong(int N) throws IOException { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    }
    
    static String[] readString(int N) throws IOException { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    }
    
    static void debug(Object ... O) { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    }
} Main
import java.io.*;
import java.util.*;

public class Main{

    public static void main(String[] args) throws IOException {
        int N = in.nextInt();
        long A[] = new long[N];
        boolean zero = false;
        for(int i = 0; i < N; i++){
            A[i] = in.nextLong();
            if(A[i] == 0){
                zero = true;
            }
        }
        
        if(zero){
            println(0);
        }
        else{
            /*
                curr = prev * a[i]
                curr <= 1e18
                prev * a[i] <= 1e18
                a[i] <= 1e18/prev
            */

            long limit = (long) 1e18;
            long res = 1;
            for(long a: A){
                if(a <= limit/res){
                    res = res * a;
                }
                else{
                    res = -1;
                    break;
                }
            }

            println(res);
        }
        in.close();
        out.close();
    }

    static int MIN = Integer.MIN_VALUE;
    static int MAX = Integer.MAX_VALUE;
    static Reader in = new Reader();
    static PrintWriter out = new PrintWriter(System.out);

    static int[] readInt(int N) throws IOException { 
    	int arr[] = new int[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextInt(); 
    	} 
    	return arr;
    }
    
    static long[] readLong(int N) throws IOException { 
    	long arr[] = new long[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.nextLong(); 
    	} 
    	return arr;
    }
    
    static String[] readString(int N) throws IOException { 
    	String arr[] = new String[N];
    	for(int i = 0; i < N; i++){ 
    		arr[i] = in.next(); 
    	} 
    	return arr;
    }
    
    static void print(Object O) {  
    	out.print(O); 
    }
    
    static void println(Object O) { 
    	out.println(O); 
    }
    
    static void println(int arr[]) { 
    	for(int i = 0; i < arr.length; i++){ 
    		print(arr[i] + " "); 
    	} 
    	println(""); 
    }
    
    static void debug(Object ... O) { 
    	for(Object obj: O){
    		System.out.print(obj + " ");
    	}
    	System.out.println();
    }
}

class Reader {
    BufferedReader reader;
    StringTokenizer tokenizer;

    Reader() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { 
            tokenizer = new StringTokenizer(reader.readLine()); 
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException { 
        return Integer.parseInt(next()); 
    }
    
    double nextDouble() throws IOException { 
        return Double.parseDouble(next());
    }
    
    long nextLong() throws IOException { 
        return Long.parseLong(next()); 
    }
    
    String nextLine() throws IOException { 
        return reader.readLine(); 
    }
    
    void close() throws IOException { 
        reader.close(); 
    }
}