import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // printTestValue();
    // abc170_d();
    abc169_b();

  }

  public static void abc169_b() {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  }
} import java.math.BigInteger; BigInteger java.math import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collections; Collections 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) {
    // printTestValue();
    // abc170_d();
    abc169_b();

  }

  public static void abc169_b() {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  }
} Main public static void main(String[] args) {
    // printTestValue();
    // abc170_d();
    abc169_b();

  } main {
    // printTestValue();
    // abc170_d();
    abc169_b();

  } abc169_b() abc169_b String[] args args public static void abc169_b() {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  } abc169_b {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  } try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    } Exception e {
      System.out.println("エラー" + e);
    } System.out.println("エラー" + e) System.out.println System.out System System.out "エラー" + e "エラー" e {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) int size = Integer.parseInt(sc.next()); size Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long ans = 1L; ans 1L List<Long> list = new ArrayList<Long>(); list new ArrayList<Long>() for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      } int xx = 0; int xx = 0; xx 0 xx < size xx size xx++ xx++ xx {
        list.add(Long.parseLong(sc.next()));
      } {
        list.add(Long.parseLong(sc.next()));
      } list.add(Long.parseLong(sc.next())) list.add list Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc Collections.sort(list) Collections.sort Collections list if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      } list.get(0) == 0L list.get(0) list.get list 0 0L {
        System.out.println(0);
        return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; Collections.reverse(list) Collections.reverse Collections list for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      } int yy = 0; int yy = 0; yy 0 yy < size yy size yy++ yy++ yy {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      } {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      } if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        } BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1 BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy))) BigInteger.valueOf(ans).multiply BigInteger.valueOf(ans) BigInteger.valueOf BigInteger ans BigInteger.valueOf(list.get(yy)) BigInteger.valueOf BigInteger list.get(yy) list.get list yy BigInteger.valueOf((long) Math.pow(10d, 18d)) BigInteger.valueOf BigInteger (long) Math.pow(10d, 18d) Math.pow Math 10d 18d 1 {
          System.out.println(-1);
          return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans *= list.get(yy) ans list.get(yy) list.get list yy System.out.println(ans) System.out.println System.out System System.out ans public class Main {

  public static void main(String[] args) {
    // printTestValue();
    // abc170_d();
    abc169_b();

  }

  public static void abc169_b() {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  }
} public class Main {

  public static void main(String[] args) {
    // printTestValue();
    // abc170_d();
    abc169_b();

  }

  public static void abc169_b() {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  }
} Main
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // printTestValue();
    // abc170_d();
    abc169_b();

  }

  public static void abc169_b() {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (BigInteger.valueOf(ans).multiply(BigInteger.valueOf(list.get(yy)))
          .compareTo(BigInteger.valueOf((long) Math.pow(10d, 18d))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  }
}