import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    long A[] =new long[N];
    double e =Math.pow(10,18);
    long f =(long) e;long l =1;
    for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}}
    for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}}
    System.out.println(l);
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    long A[] =new long[N];
    double e =Math.pow(10,18);
    long f =(long) e;long l =1;
    for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}}
    for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}}
    System.out.println(l);
  }
} Main public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    long A[] =new long[N];
    double e =Math.pow(10,18);
    long f =(long) e;long l =1;
    for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}}
    for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}}
    System.out.println(l);
  } main {
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    long A[] =new long[N];
    double e =Math.pow(10,18);
    long f =(long) e;long l =1;
    for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}}
    for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}}
    System.out.println(l);
  } Scanner sc =new Scanner(System.in); sc new Scanner(System.in) int N =sc.nextInt(); N sc.nextInt() sc.nextInt sc long A[] =new long[N]; A new long[N] N double e =Math.pow(10,18); e Math.pow(10,18) Math.pow Math 10 18 long f =(long) e; f (long) e long l =1; l 1 for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}} int j=0; int j=0; j 0 j<N j N j++ j++ j {
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}} {
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}} A[j]=sc.nextLong() A[j] A j sc.nextLong() sc.nextLong sc if(A[j]==0){System.out.println(0);System.exit(0);} A[j]==0 A[j] A j 0 {System.out.println(0);System.exit(0);} System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}} int i=0; int i=0; i 0 i<N i N i++ i++ i {
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}} {
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}} l=l*A[i] l l*A[i] l A[i] A i if(l>f||l<=0){System.out.println(-1);System.exit(0);} l>f||l<=0 l>f l f l<=0 l 0 {System.out.println(-1);System.exit(0);} System.out.println(-1) System.out.println System.out System System.out -1 1 System.exit(0) System.exit System 0 System.out.println(l) System.out.println System.out System System.out l String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    long A[] =new long[N];
    double e =Math.pow(10,18);
    long f =(long) e;long l =1;
    for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}}
    for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}}
    System.out.println(l);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    long A[] =new long[N];
    double e =Math.pow(10,18);
    long f =(long) e;long l =1;
    for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}}
    for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}}
    System.out.println(l);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    long A[] =new long[N];
    double e =Math.pow(10,18);
    long f =(long) e;long l =1;
    for(int j=0;j<N;j++){
      A[j]=sc.nextLong();if(A[j]==0){System.out.println(0);System.exit(0);}}
    for(int i=0;i<N;i++){
      l=l*A[i];
      if(l>f||l<=0){System.out.println(-1);System.exit(0);}}
    System.out.println(l);
  }
}