import java.util.*;
import java.io.*;

class Main{
    public static void main(String args[])throws IOException{
        try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        }
    }
} import java.util.*; util.* java import java.io.*; io.* java class Main{
    public static void main(String args[])throws IOException{
        try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        }
    }
} Main public static void main(String args[])throws IOException{
        try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        }
    } main {
        try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        }
    } try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        } {
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] num_s = br.readLine().split(" "); num_s br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long[] num = new long[N]; num new long[N] N boolean z_flag = false; z_flag false boolean flag = false; flag false for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          } {
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          } num[i] = Long.parseLong(num_s[i]) num[i] num i Long.parseLong(num_s[i]) Long.parseLong Long num_s[i] num_s i if(num[i] == 0){
              z_flag = true;
            } num[i] == 0 num[i] num i 0 {
              z_flag = true;
            } z_flag = true z_flag true long result = 1; result 1 long cmp = 1000000000000000000L; cmp 1000000000000000000L for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          } {
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          } result *= num[i] result num[i] num i if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            } result > cmp result cmp {
              flag = true;
              break;
            } flag = true flag true break; if(result < 1){
              flag = true;
              break;
            } result < 1 result 1 {
              flag = true;
              break;
            } flag = true flag true break; if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          } flag {
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          } if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            } z_flag {
              System.out.println("0");
            } System.out.println("0") System.out.println System.out System System.out "0" {
              System.out.println("-1");
            } System.out.println("-1") System.out.println System.out System System.out "-1" {
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          } System.out.println(result) System.out.println System.out System System.out result String args[] args
import java.util.*;
import java.io.*;

class Main{
    public static void main(String args[])throws IOException{
        try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
          int N = Integer.parseInt(br.readLine());
          String[] num_s = br.readLine().split(" ");
          long[] num = new long[N];
          boolean z_flag = false;
          boolean flag = false;

          for(int i = 0; i < N; i++){
            num[i] = Long.parseLong(num_s[i]);
            if(num[i] == 0){
              z_flag = true;
            }
          }

          long result = 1;
          long cmp = 1000000000000000000L;

          for(int i = 0; i < N; i++){
            result *= num[i];
            if(result > cmp){
              flag = true;
              break;
            }else if(result < 1){
              flag = true;
              break;
            }
            //System.out.println(result);
          }

          if(flag){
            if(z_flag){
              System.out.println("0");
            }else{
              System.out.println("-1");
            }
          }else{
            //System.out.println(Long.MAX_VALUE);
            System.out.println(result);
          }
        }
    }
}