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

public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    }
    BigDecimal now = new BigDecimal("1");
    BigDecimal max = new BigDecimal("1000000000000000000");
    for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    }
    System.out.println(now.longValue());
  }
} import java.util.*; util.* java import java.io.*; io.* java import java.math.*; math.* java public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    }
    BigDecimal now = new BigDecimal("1");
    BigDecimal max = new BigDecimal("1000000000000000000");
    for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    }
    System.out.println(now.longValue());
  }
} Main public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    }
    BigDecimal now = new BigDecimal("1");
    BigDecimal max = new BigDecimal("1000000000000000000");
    for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    }
    System.out.println(now.longValue());
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    }
    BigDecimal now = new BigDecimal("1");
    BigDecimal max = new BigDecimal("1000000000000000000");
    for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    }
    System.out.println(now.longValue());
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.nextLine()); N Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc String[] S = sc.nextLine().split(" "); S sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    } {
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    } long a = Long.parseLong(S[i]); a Long.parseLong(S[i]) Long.parseLong Long S[i] S i if(a == 0){
        System.out.println(0);
        return;
      } a == 0 a 0 {
        System.out.println(0);
        return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; BigDecimal now = new BigDecimal("1"); now new BigDecimal("1") BigDecimal max = new BigDecimal("1000000000000000000"); max new BigDecimal("1000000000000000000") for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    } {
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    } BigDecimal A = new BigDecimal(S[i]); A new BigDecimal(S[i]) now = now.multiply(A) now now.multiply(A) now.multiply now A if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      } now.compareTo(max) == 1 now.compareTo(max) now.compareTo now max 1 {
        now = new BigDecimal("-1");
        break;
      } now = new BigDecimal("-1") now new BigDecimal("-1") break; System.out.println(now.longValue()) System.out.println System.out System System.out now.longValue() now.longValue now String[] args args public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    }
    BigDecimal now = new BigDecimal("1");
    BigDecimal max = new BigDecimal("1000000000000000000");
    for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    }
    System.out.println(now.longValue());
  }
} public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    }
    BigDecimal now = new BigDecimal("1");
    BigDecimal max = new BigDecimal("1000000000000000000");
    for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    }
    System.out.println(now.longValue());
  }
} Main
import java.util.*;
import java.io.*;
import java.math.*;

public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String[] S = sc.nextLine().split(" ");
    for(int i = 0; i < N; i++){
      long a = Long.parseLong(S[i]);
      if(a == 0){
        System.out.println(0);
        return;
      }
    }
    BigDecimal now = new BigDecimal("1");
    BigDecimal max = new BigDecimal("1000000000000000000");
    for(int i = 0; i < N; i++){
      BigDecimal A = new BigDecimal(S[i]);
      now = now.multiply(A);
      if(now.compareTo(max) == 1){
        now = new BigDecimal("-1");
        break;
      }
    }
    System.out.println(now.longValue());
  }
}
