import java.util.*;
import java.math.BigInteger;

public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    BigInteger product = new BigInteger("1");
    boolean smaller = true;
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    }
    
    if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    }
  }
} import java.util.*; util.* java import java.math.BigInteger; BigInteger java.math public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    BigInteger product = new BigInteger("1");
    boolean smaller = true;
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    }
    
    if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    }
  }
} Main public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    BigInteger product = new BigInteger("1");
    boolean smaller = true;
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    }
    
    if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    }
  } main {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    BigInteger product = new BigInteger("1");
    boolean smaller = true;
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    }
    
    if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    }
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long N = scan.nextLong(); N scan.nextLong() scan.nextLong scan long limit = (long) Math.pow(10,18); limit (long) Math.pow(10,18) Math.pow Math 10 18 BigInteger product = new BigInteger("1"); product new BigInteger("1") boolean smaller = true; smaller true for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    } {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    } long A_i = scan.nextLong(); A_i scan.nextLong() scan.nextLong scan if (A_i == 0) {
        System.out.println(0);
        return;
      } A_i == 0 A_i 0 {
        System.out.println(0);
        return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      } smaller {
          product = product.multiply(BigInteger.valueOf(A_i));
      } product = product.multiply(BigInteger.valueOf(A_i)) product product.multiply(BigInteger.valueOf(A_i)) product.multiply product BigInteger.valueOf(A_i) BigInteger.valueOf BigInteger A_i if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      } smaller && product.compareTo(BigInteger.valueOf(limit)) == 1 smaller product.compareTo(BigInteger.valueOf(limit)) == 1 product.compareTo(BigInteger.valueOf(limit)) product.compareTo product BigInteger.valueOf(limit) BigInteger.valueOf BigInteger limit 1 {
        smaller = false;
      } smaller = false smaller false if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    } smaller {
      System.out.println(product);
    } System.out.println(product) System.out.println System.out System System.out product {
      System.out.println(-1);
    } System.out.println(-1) System.out.println System.out System System.out -1 1 String[] args args public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    BigInteger product = new BigInteger("1");
    boolean smaller = true;
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    }
    
    if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    }
  }
} public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    BigInteger product = new BigInteger("1");
    boolean smaller = true;
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    }
    
    if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    }
  }
} Main
import java.util.*;
import java.math.BigInteger;

public class Main {
  
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    long N = scan.nextLong();
    long limit = (long) Math.pow(10,18);
    BigInteger product = new BigInteger("1");
    boolean smaller = true;
    
    for (int i = 1; i <= N; i++) {
      long A_i = scan.nextLong();
      
      if (A_i == 0) {
        System.out.println(0);
        return;
      }
      
      if (smaller) {
          product = product.multiply(BigInteger.valueOf(A_i));
      }
      
      if (smaller && product.compareTo(BigInteger.valueOf(limit)) == 1) {
        smaller = false;
      }  
    }
    
    if (smaller) {
      System.out.println(product);
    }
    
    else {
      System.out.println(-1);
    }
  }
}
