import java.util.*;
import java.io.*;
public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      long n = Long.parseLong(st.nextToken());
     st = new StringTokenizer(br.readLine());
     long prod = 1;
     boolean fail = false;
      for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      }
     if(fail)
       out.println(-1);
     else
       out.println(prod);
      out.close();
   }
}
 import java.util.*; util.* java import java.io.*; io.* java public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      long n = Long.parseLong(st.nextToken());
     st = new StringTokenizer(br.readLine());
     long prod = 1;
     boolean fail = false;
      for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      }
     if(fail)
       out.println(-1);
     else
       out.println(prod);
      out.close();
   }
} Main public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      long n = Long.parseLong(st.nextToken());
     st = new StringTokenizer(br.readLine());
     long prod = 1;
     boolean fail = false;
      for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      }
     if(fail)
       out.println(-1);
     else
       out.println(prod);
      out.close();
   } main {
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      long n = Long.parseLong(st.nextToken());
     st = new StringTokenizer(br.readLine());
     long prod = 1;
     boolean fail = false;
      for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      }
     if(fail)
       out.println(-1);
     else
       out.println(prod);
      out.close();
   } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) long n = Long.parseLong(st.nextToken()); n Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) long prod = 1; prod 1 boolean fail = false; fail false for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      } {
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      } long next = Long.parseLong(st.nextToken()); next Long.parseLong(st.nextToken()) Long.parseLong Long st.nextToken() st.nextToken st if(next == 0){
          prod = 0;
          fail = false;
          break;
        } next == 0 next 0 {
          prod = 0;
          fail = false;
          break;
        } prod = 0 prod 0 fail = false fail false break; if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next; ((long)Math.pow(10,18))/prod < next ((long)Math.pow(10,18))/prod ((long)Math.pow(10,18)) Math.pow Math 10 18 prod next {
          fail = true;
        } fail = true fail true prod *= next prod next if(fail)
       out.println(-1);
     else
       out.println(prod); fail out.println(-1) out.println out -1 1 out.println(prod) out.println out prod out.close() out.close out String[] main main public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      long n = Long.parseLong(st.nextToken());
     st = new StringTokenizer(br.readLine());
     long prod = 1;
     boolean fail = false;
      for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      }
     if(fail)
       out.println(-1);
     else
       out.println(prod);
      out.close();
   }
} public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      long n = Long.parseLong(st.nextToken());
     st = new StringTokenizer(br.readLine());
     long prod = 1;
     boolean fail = false;
      for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      }
     if(fail)
       out.println(-1);
     else
       out.println(prod);
      out.close();
   }
} Main
import java.util.*;
import java.io.*;
public class Main{
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      long n = Long.parseLong(st.nextToken());
     st = new StringTokenizer(br.readLine());
     long prod = 1;
     boolean fail = false;
      for(int i = 0; i < n; i++){
        long next = Long.parseLong(st.nextToken());
        if(next == 0){
          prod = 0;
          fail = false;
          break;
        }
        if(((long)Math.pow(10,18))/prod < next){
          fail = true;
        }
        else
          prod *= next;
      }
     if(fail)
       out.println(-1);
     else
       out.println(prod);
      out.close();
   }
}

