
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    sc.nextLine();
    List<Long> l = new ArrayList<Long>();
    for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    }

    if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    }

    sc.close();
  }

} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    sc.nextLine();
    List<Long> l = new ArrayList<Long>();
    for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    }

    if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    }

    sc.close();
  }

} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    sc.nextLine();
    List<Long> l = new ArrayList<Long>();
    for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    }

    if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    }

    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    sc.nextLine();
    List<Long> l = new ArrayList<Long>();
    for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    }

    if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    }

    sc.close();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc List<Long> l = new ArrayList<Long>(); l new ArrayList<Long>() for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      l.add(sc.nextLong());
    } {
      l.add(sc.nextLong());
    } l.add(sc.nextLong()) l.add l sc.nextLong() sc.nextLong sc if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    } l.contains(0L) l.contains l 0L {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    } Long max = 1000000000L * 1000000000; max 1000000000L * 1000000000 1000000000L 1000000000 Long sum = 1L; sum 1L for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      } Long l2 l {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      } {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      } if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        } sum > max/l2 sum max/l2 max l2 {
          System.out.println(-1);
          sum = 0L;
          return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 sum = 0L sum 0L return; sum *= l2 sum l2 System.out.println(sum) System.out.println System.out System System.out sum sc.close() sc.close sc String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    sc.nextLine();
    List<Long> l = new ArrayList<Long>();
    for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    }

    if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    }

    sc.close();
  }

} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    sc.nextLine();
    List<Long> l = new ArrayList<Long>();
    for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    }

    if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    }

    sc.close();
  }

} Main

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    sc.nextLine();
    List<Long> l = new ArrayList<Long>();
    for(int i = 0;i < n;i++) {
      l.add(sc.nextLong());
    }

    if(l.contains(0L)) {
      System.out.println(0);
    }else {
      Long max = 1000000000L * 1000000000;

      Long sum = 1L;

      for(Long l2:l) {
        if(sum > max/l2) {
          System.out.println(-1);
          sum = 0L;
          return;
        }
        sum *= l2;
      }
      System.out.println(sum);
    }

    sc.close();
  }

}
