import java.util.*;

class Main{

  public static void main(String args[]){

    Scanner s=new Scanner(System.in);
    int N=s.nextInt();
    long[] List=new long[N];
    for(int i=0;i<N;i++) List[i]=s.nextLong();
    Arrays.sort(List);
    double d=0d;
    for(int i=0;i<N;i++) d+=Math.log10(List[i]);
    long ans=1;
    long comp=(long)Math.pow(10,18);
    
    if(d<=18){
      for(int i=0;i<N;i++) ans*=List[i];
      if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1);
    }
    else System.out.println(-1);  
  }  
} import java.util.*; util.* java class Main{

  public static void main(String args[]){

    Scanner s=new Scanner(System.in);
    int N=s.nextInt();
    long[] List=new long[N];
    for(int i=0;i<N;i++) List[i]=s.nextLong();
    Arrays.sort(List);
    double d=0d;
    for(int i=0;i<N;i++) d+=Math.log10(List[i]);
    long ans=1;
    long comp=(long)Math.pow(10,18);
    
    if(d<=18){
      for(int i=0;i<N;i++) ans*=List[i];
      if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1);
    }
    else System.out.println(-1);  
  }  
} Main public static void main(String args[]){

    Scanner s=new Scanner(System.in);
    int N=s.nextInt();
    long[] List=new long[N];
    for(int i=0;i<N;i++) List[i]=s.nextLong();
    Arrays.sort(List);
    double d=0d;
    for(int i=0;i<N;i++) d+=Math.log10(List[i]);
    long ans=1;
    long comp=(long)Math.pow(10,18);
    
    if(d<=18){
      for(int i=0;i<N;i++) ans*=List[i];
      if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1);
    }
    else System.out.println(-1);  
  } main {

    Scanner s=new Scanner(System.in);
    int N=s.nextInt();
    long[] List=new long[N];
    for(int i=0;i<N;i++) List[i]=s.nextLong();
    Arrays.sort(List);
    double d=0d;
    for(int i=0;i<N;i++) d+=Math.log10(List[i]);
    long ans=1;
    long comp=(long)Math.pow(10,18);
    
    if(d<=18){
      for(int i=0;i<N;i++) ans*=List[i];
      if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1);
    }
    else System.out.println(-1);  
  } Scanner s=new Scanner(System.in); s new Scanner(System.in) int N=s.nextInt(); N s.nextInt() s.nextInt s long[] List=new long[N]; List new long[N] N for(int i=0;i<N;i++) List[i]=s.nextLong(); int i=0; int i=0; i 0 i<N i N i++ i++ i List[i]=s.nextLong(); List[i]=s.nextLong() List[i] List i s.nextLong() s.nextLong s Arrays.sort(List) Arrays.sort Arrays List double d=0d; d 0d for(int i=0;i<N;i++) d+=Math.log10(List[i]); int i=0; int i=0; i 0 i<N i N i++ i++ i d+=Math.log10(List[i]); d+=Math.log10(List[i]) d Math.log10(List[i]) Math.log10 Math List[i] List i long ans=1; ans 1 long comp=(long)Math.pow(10,18); comp (long)Math.pow(10,18) Math.pow Math 10 18 if(d<=18){
      for(int i=0;i<N;i++) ans*=List[i];
      if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1);
    }
    else System.out.println(-1); d<=18 d 18 {
      for(int i=0;i<N;i++) ans*=List[i];
      if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1);
    } for(int i=0;i<N;i++) ans*=List[i]; int i=0; int i=0; i 0 i<N i N i++ i++ i ans*=List[i]; ans*=List[i] ans List[i] List i if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1); ans<=1000000000000000000L ans 1000000000000000000L System.out.println(ans) System.out.println System.out System System.out ans System.out.println(-1) System.out.println System.out System System.out -1 1 System.out.println(-1) System.out.println System.out System System.out -1 1 String args[] args
import java.util.*;

class Main{

  public static void main(String args[]){

    Scanner s=new Scanner(System.in);
    int N=s.nextInt();
    long[] List=new long[N];
    for(int i=0;i<N;i++) List[i]=s.nextLong();
    Arrays.sort(List);
    double d=0d;
    for(int i=0;i<N;i++) d+=Math.log10(List[i]);
    long ans=1;
    long comp=(long)Math.pow(10,18);
    
    if(d<=18){
      for(int i=0;i<N;i++) ans*=List[i];
      if(ans<=1000000000000000000L) System.out.println(ans);
      else System.out.println(-1);
    }
    else System.out.println(-1);  
  }  
}