import java.util.Scanner;
import java.util.Comparator;
import java.util.Arrays;
import java.math.BigInteger;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    BigInteger A[] = new BigInteger[N];
    BigInteger big = new BigInteger("1000000000000000000");
    BigInteger result = BigInteger.ONE;
    BigInteger zero = new BigInteger("0");
    int K = 0;
    for (int i = 0;i < N;i++) {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    }
    if (K > 0) {
      for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    else{
      for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    System.out.println(result);
  }
} import java.util.Scanner; Scanner java.util import java.util.Comparator; Comparator java.util import java.util.Arrays; Arrays java.util import java.math.BigInteger; BigInteger java.math class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    BigInteger A[] = new BigInteger[N];
    BigInteger big = new BigInteger("1000000000000000000");
    BigInteger result = BigInteger.ONE;
    BigInteger zero = new BigInteger("0");
    int K = 0;
    for (int i = 0;i < N;i++) {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    }
    if (K > 0) {
      for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    else{
      for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    System.out.println(result);
  }
} Main public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    BigInteger A[] = new BigInteger[N];
    BigInteger big = new BigInteger("1000000000000000000");
    BigInteger result = BigInteger.ONE;
    BigInteger zero = new BigInteger("0");
    int K = 0;
    for (int i = 0;i < N;i++) {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    }
    if (K > 0) {
      for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    else{
      for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    System.out.println(result);
  } main {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    BigInteger A[] = new BigInteger[N];
    BigInteger big = new BigInteger("1000000000000000000");
    BigInteger result = BigInteger.ONE;
    BigInteger zero = new BigInteger("0");
    int K = 0;
    for (int i = 0;i < N;i++) {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    }
    if (K > 0) {
      for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    else{
      for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    System.out.println(result);
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan BigInteger A[] = new BigInteger[N]; A new BigInteger[N] N BigInteger big = new BigInteger("1000000000000000000"); big new BigInteger("1000000000000000000") BigInteger result = BigInteger.ONE; result BigInteger.ONE BigInteger BigInteger.ONE BigInteger zero = new BigInteger("0"); zero new BigInteger("0") int K = 0; K 0 for (int i = 0;i < N;i++) {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    } {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    } A[i] = scan.nextBigInteger() A[i] A i scan.nextBigInteger() scan.nextBigInteger scan if (A[i].compareTo(zero) == 0) {
        K = i;
      } A[i].compareTo(zero) == 0 A[i].compareTo(zero) A[i].compareTo A[i] A i zero 0 {
        K = i;
      } K = i K i if (K > 0) {
      for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    else{
      for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    } K > 0 K 0 {
      for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    } for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      } int i = K; int i = K; i K i < N i N i++ i++ i {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      } {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      } result = result.multiply(A[i]) result result.multiply(A[i]) result.multiply result A[i] A i if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        } result.compareTo(big) > 0 result.compareTo(big) result.compareTo result big 0 {
          System.out.println(-1);
          return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
      for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    } for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      } {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      } result = result.multiply(A[i]) result result.multiply(A[i]) result.multiply result A[i] A i if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        } result.compareTo(big) > 0 result.compareTo(big) result.compareTo result big 0 {
          System.out.println(-1);
          return;
        } System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(result) System.out.println System.out System System.out result String[] args args
import java.util.Scanner;
import java.util.Comparator;
import java.util.Arrays;
import java.math.BigInteger;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    BigInteger A[] = new BigInteger[N];
    BigInteger big = new BigInteger("1000000000000000000");
    BigInteger result = BigInteger.ONE;
    BigInteger zero = new BigInteger("0");
    int K = 0;
    for (int i = 0;i < N;i++) {
      A[i] = scan.nextBigInteger();
      if (A[i].compareTo(zero) == 0) {
        K = i;
      }
    }
    if (K > 0) {
      for (int i = K;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    else{
      for (int i = 0;i < N;i++) {
        result = result.multiply(A[i]);
        if (result.compareTo(big) > 0) {
          System.out.println(-1);
          return;
        }
      }
    }
    System.out.println(result);
  }
}