import java.util.*;
 
public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long [] A = new long [N];
        long number = 1;
        long max = 1000000000000000000L;
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        }
        
        for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        }
            
            System.out.println(number);
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long [] A = new long [N];
        long number = 1;
        long max = 1000000000000000000L;
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        }
        
        for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        }
            
            System.out.println(number);
        
    }
} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long [] A = new long [N];
        long number = 1;
        long max = 1000000000000000000L;
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        }
        
        for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        }
            
            System.out.println(number);
        
    } main {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long [] A = new long [N];
        long number = 1;
        long max = 1000000000000000000L;
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        }
        
        for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        }
            
            System.out.println(number);
        
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner long [] A = new long [N]; A new long [N] N long number = 1; number 1 long max = 1000000000000000000L; max 1000000000000000000L for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            A[i] = scanner.nextLong();
        } {
            A[i] = scanner.nextLong();
        } A[i] = scanner.nextLong() A[i] A i scanner.nextLong() scanner.nextLong scanner for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        } int i = 0; int i = 0; i 0 i<N i N i++ i++ i { 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        } { 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        } if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            } A[i] ==0 A[i] A i 0 {
                number = 0;
                break;
            } number = 0 number 0 break; if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            } A[i]<=(max/number) A[i] A i (max/number) max number {
                number *= A[i];
            } number *= A[i] number A[i] A i {
                number = -1;
            } number = -1 number -1 1 System.out.println(number) System.out.println System.out System System.out number String[] args args public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long [] A = new long [N];
        long number = 1;
        long max = 1000000000000000000L;
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        }
        
        for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        }
            
            System.out.println(number);
        
    }
} public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long [] A = new long [N];
        long number = 1;
        long max = 1000000000000000000L;
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        }
        
        for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        }
            
            System.out.println(number);
        
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        long [] A = new long [N];
        long number = 1;
        long max = 1000000000000000000L;
        
        for(int i=0; i<N; i++){
            A[i] = scanner.nextLong();
        }
        
        for(int i = 0; i<N; i++){ 
         
        if(A[i] ==0){
                number = 0;
                break;
            }
            else if(A[i]<=(max/number)){
                number *= A[i];
            }
            else{
                number = -1;
            }
        }
            
            System.out.println(number);
        
    }
}