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

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigInteger[] A = new BigInteger[N];
    BigInteger sum = BigInteger.ONE;
    
    for(int i=0; i<N; i++){
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    }
    
    for(int i=0; i<N; i++){
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    }
    
    System.out.println(sum);
  }
} import java.util.*; util.* java import java.math.*; math.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigInteger[] A = new BigInteger[N];
    BigInteger sum = BigInteger.ONE;
    
    for(int i=0; i<N; i++){
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    }
    
    for(int i=0; i<N; i++){
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    }
    
    System.out.println(sum);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigInteger[] A = new BigInteger[N];
    BigInteger sum = BigInteger.ONE;
    
    for(int i=0; i<N; i++){
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    }
    
    for(int i=0; i<N; i++){
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    }
    
    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigInteger[] A = new BigInteger[N];
    BigInteger sum = BigInteger.ONE;
    
    for(int i=0; i<N; i++){
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    }
    
    for(int i=0; i<N; i++){
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    }
    
    System.out.println(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc BigInteger[] A = new BigInteger[N]; A new BigInteger[N] N BigInteger sum = BigInteger.ONE; sum BigInteger.ONE BigInteger BigInteger.ONE for(int i=0; i<N; i++){
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    } {
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    } A[i] = sc.nextBigInteger() A[i] A i sc.nextBigInteger() sc.nextBigInteger sc if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      } A[i].compareTo(BigInteger.ZERO) == 0 A[i].compareTo(BigInteger.ZERO) A[i].compareTo A[i] A i BigInteger.ZERO BigInteger BigInteger.ZERO 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++){
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    } {
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    } sum = sum.multiply(A[i]) sum sum.multiply(A[i]) sum.multiply sum A[i] A i if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      } sum.compareTo(new BigInteger("1000000000000000000")) == 1 sum.compareTo(new BigInteger("1000000000000000000")) sum.compareTo sum new BigInteger("1000000000000000000") 1 {
        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(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;
import java.math.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    BigInteger[] A = new BigInteger[N];
    BigInteger sum = BigInteger.ONE;
    
    for(int i=0; i<N; i++){
      A[i] = sc.nextBigInteger();
      if(A[i].compareTo(BigInteger.ZERO) == 0){
        System.out.println(0);
        System.exit(0);
      }
    }
    
    for(int i=0; i<N; i++){
      sum = sum.multiply(A[i]);
      if(sum.compareTo(new BigInteger("1000000000000000000")) == 1){
        System.out.println(-1);
        System.exit(0);
      }
    }
    
    System.out.println(sum);
  }
}