import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.nextLine();
    long multi = 1;
    long max = (long)Math.pow(10.0, 18.0);
    long[] nums = new long[num];
    
    for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    }
    for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    }
    
     System.out.println(multi);
    
  }

} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.nextLine();
    long multi = 1;
    long max = (long)Math.pow(10.0, 18.0);
    long[] nums = new long[num];
    
    for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    }
    for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    }
    
     System.out.println(multi);
    
  }

} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.nextLine();
    long multi = 1;
    long max = (long)Math.pow(10.0, 18.0);
    long[] nums = new long[num];
    
    for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    }
    for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    }
    
     System.out.println(multi);
    
  } main {
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.nextLine();
    long multi = 1;
    long max = (long)Math.pow(10.0, 18.0);
    long[] nums = new long[num];
    
    for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    }
    for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    }
    
     System.out.println(multi);
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc long multi = 1; multi 1 long max = (long)Math.pow(10.0, 18.0); max (long)Math.pow(10.0, 18.0) Math.pow Math 10.0 18.0 long[] nums = new long[num]; nums new long[num] num for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    } {
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    } nums[i] = sc.nextLong() nums[i] nums i sc.nextLong() sc.nextLong sc if(nums[i] == 0){
      	System.out.println(0);
        return;
      } nums[i] == 0 nums[i] nums i 0 {
      	System.out.println(0);
        return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    } int j = 0; int j = 0; j 0 j < num j num j++ j++ j {
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    } {
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    } if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      } multi <= max / nums[j] multi max / nums[j] max nums[j] nums j {
        multi *= nums[j];
      } multi *= nums[j] multi nums[j] nums j {
      	System.out.println("-1");
        return;
      } System.out.println("-1") System.out.println System.out System System.out "-1" return; System.out.println(multi) System.out.println System.out System System.out multi String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.nextLine();
    long multi = 1;
    long max = (long)Math.pow(10.0, 18.0);
    long[] nums = new long[num];
    
    for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    }
    for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    }
    
     System.out.println(multi);
    
  }

} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.nextLine();
    long multi = 1;
    long max = (long)Math.pow(10.0, 18.0);
    long[] nums = new long[num];
    
    for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    }
    for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    }
    
     System.out.println(multi);
    
  }

} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.nextLine();
    long multi = 1;
    long max = (long)Math.pow(10.0, 18.0);
    long[] nums = new long[num];
    
    for(int i = 0; i < num; i++){
      nums[i] = sc.nextLong();
      if(nums[i] == 0){
      	System.out.println(0);
        return;
      }
    }
    for(int j = 0; j < num; j++){
      if(multi <= max / nums[j]){
        multi *= nums[j];
      }else{
      	System.out.println("-1");
        return;
      }
    }
    
     System.out.println(multi);
    
  }

}