import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long acum = 1;
    boolean cs = false;
    for(int i = 0; i < n; i++) {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    }
    sc.close();
    if(acum != 0 && (acum > 1000000000000000000L || cs)) {
      System.out.println("-1");
    } else {
      System.out.println(acum);
    }
  }
} import java.util.Scanner; Scanner java.util class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long acum = 1;
    boolean cs = false;
    for(int i = 0; i < n; i++) {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    }
    sc.close();
    if(acum != 0 && (acum > 1000000000000000000L || cs)) {
      System.out.println("-1");
    } else {
      System.out.println(acum);
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long acum = 1;
    boolean cs = false;
    for(int i = 0; i < n; i++) {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    }
    sc.close();
    if(acum != 0 && (acum > 1000000000000000000L || cs)) {
      System.out.println("-1");
    } else {
      System.out.println(acum);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long acum = 1;
    boolean cs = false;
    for(int i = 0; i < n; i++) {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    }
    sc.close();
    if(acum != 0 && (acum > 1000000000000000000L || cs)) {
      System.out.println("-1");
    } else {
      System.out.println(acum);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long acum = 1; acum 1 boolean cs = false; cs false for(int i = 0; i < n; i++) {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    } {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    } try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      } catch(ArithmeticException e) {
        cs = true;
      } ArithmeticException e {
        cs = true;
      } cs = true cs true {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } acum = Math.multiplyExact(acum, sc.nextLong()) acum Math.multiplyExact(acum, sc.nextLong()) Math.multiplyExact Math acum sc.nextLong() sc.nextLong sc sc.close() sc.close sc if(acum != 0 && (acum > 1000000000000000000L || cs)) {
      System.out.println("-1");
    } else {
      System.out.println(acum);
    } acum != 0 && (acum > 1000000000000000000L || cs) acum != 0 acum 0 (acum > 1000000000000000000L || cs) acum > 1000000000000000000L acum 1000000000000000000L cs {
      System.out.println("-1");
    } System.out.println("-1") System.out.println System.out System System.out "-1" {
      System.out.println(acum);
    } System.out.println(acum) System.out.println System.out System System.out acum String[] args args
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long acum = 1;
    boolean cs = false;
    for(int i = 0; i < n; i++) {
      try {
        acum = Math.multiplyExact(acum, sc.nextLong());      
      } catch(ArithmeticException e) {
        cs = true;
      }
    }
    sc.close();
    if(acum != 0 && (acum > 1000000000000000000L || cs)) {
      System.out.println("-1");
    } else {
      System.out.println(acum);
    }
  }
}