import java.util.*;
import java.math.BigInteger;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    BigInteger[] A = new BigInteger[n];
    BigInteger max = new BigInteger("1000000000000000000");
    for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    }
    Arrays.sort(A);
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    }
    if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
} import java.util.*; util.* java import java.math.BigInteger; BigInteger java.math public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    BigInteger[] A = new BigInteger[n];
    BigInteger max = new BigInteger("1000000000000000000");
    for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    }
    Arrays.sort(A);
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    }
    if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    BigInteger[] A = new BigInteger[n];
    BigInteger max = new BigInteger("1000000000000000000");
    for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    }
    Arrays.sort(A);
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    }
    if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    BigInteger[] A = new BigInteger[n];
    BigInteger max = new BigInteger("1000000000000000000");
    for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    }
    Arrays.sort(A);
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    }
    if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc BigInteger[] A = new BigInteger[n]; A new BigInteger[n] n BigInteger max = new BigInteger("1000000000000000000"); max new BigInteger("1000000000000000000") for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      A[i] = sc.nextBigInteger();
    } {
      A[i] = sc.nextBigInteger();
    } A[i] = sc.nextBigInteger() A[i] A i sc.nextBigInteger() sc.nextBigInteger sc Arrays.sort(A) Arrays.sort Arrays A BigInteger ans = BigInteger.ONE; ans BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    } {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    } ans = ans.multiply(A[i]) ans ans.multiply(A[i]) ans.multiply ans A[i] A i if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      } ans.compareTo(max) == 1 || ans.equals(0) ans.compareTo(max) == 1 ans.compareTo(max) ans.compareTo ans max 1 ans.equals(0) ans.equals ans 0 {
        break;
      } break; if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    } ans.compareTo(max) == 1 ans.compareTo(max) ans.compareTo ans max 1 {
      System.out.println(-1);
    } System.out.println(-1) System.out.println System.out System System.out -1 1 {
      System.out.println(ans);
    } System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    BigInteger[] A = new BigInteger[n];
    BigInteger max = new BigInteger("1000000000000000000");
    for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    }
    Arrays.sort(A);
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    }
    if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    BigInteger[] A = new BigInteger[n];
    BigInteger max = new BigInteger("1000000000000000000");
    for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    }
    Arrays.sort(A);
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    }
    if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
} Main
import java.util.*;
import java.math.BigInteger;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    BigInteger[] A = new BigInteger[n];
    BigInteger max = new BigInteger("1000000000000000000");
    for (int i = 0; i < n; i++) {
      A[i] = sc.nextBigInteger();
    }
    Arrays.sort(A);
    BigInteger ans = BigInteger.ONE;
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(A[i]);
      if (ans.compareTo(max) == 1 || ans.equals(0)) {
        break;
      }
    }
    if (ans.compareTo(max) == 1) {
      System.out.println(-1);
    } else {
      System.out.println(ans);
    }
  }
}
