import java.util.*;
import java.math.*;

public class Main {

  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigDecimal[] A = new BigDecimal[N+1];
    BigDecimal a = new BigDecimal(1);
    BigDecimal b = new BigDecimal(Math.pow(10,18));
    BigDecimal c = new BigDecimal(0);
    int check =0;
    for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    }
    if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    }
    if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    }
  }
} import java.util.*; util.* java import java.math.*; math.* java public class Main {

  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigDecimal[] A = new BigDecimal[N+1];
    BigDecimal a = new BigDecimal(1);
    BigDecimal b = new BigDecimal(Math.pow(10,18));
    BigDecimal c = new BigDecimal(0);
    int check =0;
    for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    }
    if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    }
    if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    }
  }
} Main public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigDecimal[] A = new BigDecimal[N+1];
    BigDecimal a = new BigDecimal(1);
    BigDecimal b = new BigDecimal(Math.pow(10,18));
    BigDecimal c = new BigDecimal(0);
    int check =0;
    for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    }
    if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    }
    if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigDecimal[] A = new BigDecimal[N+1];
    BigDecimal a = new BigDecimal(1);
    BigDecimal b = new BigDecimal(Math.pow(10,18));
    BigDecimal c = new BigDecimal(0);
    int check =0;
    for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    }
    if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    }
    if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc BigDecimal[] A = new BigDecimal[N+1]; A new BigDecimal[N+1] N+1 N 1 BigDecimal a = new BigDecimal(1); a new BigDecimal(1) BigDecimal b = new BigDecimal(Math.pow(10,18)); b new BigDecimal(Math.pow(10,18)) BigDecimal c = new BigDecimal(0); c new BigDecimal(0) int check =0; check 0 for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    } int i =1; int i =1; i 1 i<=N i N i++ i++ i {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    } {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    } A[i] = sc.nextBigDecimal() A[i] A i sc.nextBigDecimal() sc.nextBigDecimal sc if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      } A[i].compareTo(c) == 0 A[i].compareTo(c) A[i].compareTo A[i] A i c 0 {
        a = new BigDecimal(0);
        break;
      } a = new BigDecimal(0) a new BigDecimal(0) break; if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    } a.compareTo(c) != 0 a.compareTo(c) a.compareTo a c 0 {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    } for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      } int i =1; int i =1; i 1 i<=N i N i++ i++ i {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      } {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      } a = a.multiply(A[i]) a a.multiply(A[i]) a.multiply a A[i] A i if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        } a.compareTo(b) >0 a.compareTo(b) a.compareTo a b 0 {
          a = new BigDecimal(1);
          check++;
        } a = new BigDecimal(1) a new BigDecimal(1) check++ check if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    } a.compareTo(c) == 0 a.compareTo(c) a.compareTo a c 0 {
      System.out.println(0);
    } System.out.println(0) System.out.println System.out System System.out 0 if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    } check != 0 check 0 {
      System.out.println(-1);
    } System.out.println(-1) System.out.println System.out System System.out -1 1 {
      System.out.println(a);
    } System.out.println(a) System.out.println System.out System System.out a String[] args args public class Main {

  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigDecimal[] A = new BigDecimal[N+1];
    BigDecimal a = new BigDecimal(1);
    BigDecimal b = new BigDecimal(Math.pow(10,18));
    BigDecimal c = new BigDecimal(0);
    int check =0;
    for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    }
    if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    }
    if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    }
  }
} public class Main {

  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigDecimal[] A = new BigDecimal[N+1];
    BigDecimal a = new BigDecimal(1);
    BigDecimal b = new BigDecimal(Math.pow(10,18));
    BigDecimal c = new BigDecimal(0);
    int check =0;
    for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    }
    if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    }
    if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    }
  }
} Main
import java.util.*;
import java.math.*;

public class Main {

  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigDecimal[] A = new BigDecimal[N+1];
    BigDecimal a = new BigDecimal(1);
    BigDecimal b = new BigDecimal(Math.pow(10,18));
    BigDecimal c = new BigDecimal(0);
    int check =0;
    for (int i =1; i<=N; i++) {
      A[i] = sc.nextBigDecimal();
      if (A[i].compareTo(c) == 0) {
        a = new BigDecimal(0);
        break;
      }
    }
    if (a.compareTo(c) != 0) {
      for (int i =1; i<=N; i++) {
        a = a.multiply(A[i]);
        if (a.compareTo(b) >0) {
          a = new BigDecimal(1);
          check++;
        }
      }
    }
    if (a.compareTo(c) == 0) {
      System.out.println(0);
    } else if (check != 0) {
      System.out.println(-1);
    } else {
      System.out.println(a);
    }
  }
}