import java.util.*;
 
public class Main{
	public static void main(String[] args){
	    Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
        long number[] = new long[num];
        long mul = 1;
        for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        }
        if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        }
        System.out.println(mul);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
	    Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
        long number[] = new long[num];
        long mul = 1;
        for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        }
        if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        }
        System.out.println(mul);
	}
} Main public static void main(String[] args){
	    Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
        long number[] = new long[num];
        long mul = 1;
        for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        }
        if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        }
        System.out.println(mul);
	} main {
	    Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
        long number[] = new long[num];
        long mul = 1;
        for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        }
        if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        }
        System.out.println(mul);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc long number[] = new long[num]; number new long[num] num long mul = 1; mul 1 for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        } {
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        } number[i] = sc.nextLong() number[i] number i sc.nextLong() sc.nextLong sc if(number[i] == 0){
            	mul = 0;
            } number[i] == 0 number[i] number i 0 {
            	mul = 0;
            } mul = 0 mul 0 if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        } mul != 0 mul 0 {
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        } for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	} int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	} {
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	} if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                } number[i] <= (long)Math.pow(10,18)/mul number[i] number i (long)Math.pow(10,18)/mul (long)Math.pow(10,18) Math.pow Math 10 18 mul {
        			mul = mul * number[i];
          		} mul = mul * number[i] mul mul * number[i] mul number[i] number i {
          			mul = -1;
                    break;
                } mul = -1 mul -1 1 break; System.out.println(mul) System.out.println System.out System System.out mul String[] args args public class Main{
	public static void main(String[] args){
	    Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
        long number[] = new long[num];
        long mul = 1;
        for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        }
        if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        }
        System.out.println(mul);
	}
} public class Main{
	public static void main(String[] args){
	    Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
        long number[] = new long[num];
        long mul = 1;
        for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        }
        if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        }
        System.out.println(mul);
	}
} Main
import java.util.*;
 
public class Main{
	public static void main(String[] args){
	    Scanner sc = new Scanner(System.in);
    	int num = sc.nextInt();
        long number[] = new long[num];
        long mul = 1;
        for(int i = 0; i < num; i++){
        	number[i] = sc.nextLong();
            if(number[i] == 0){
            	mul = 0;
            }
        }
        if(mul != 0){
        	for(int i = 0; i < num; i++){
          		if(number[i] <= (long)Math.pow(10,18)/mul){
        			mul = mul * number[i];
          		}else{
          			mul = -1;
                    break;
                }
          	}
        }
        System.out.println(mul);
	}
}