import java.util.*;
  public class Main {
    public static void main(String[] args) {
     
        //sec--1 (definition)
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long cal = 1;
        long max = (long)Math.pow(10,18);
      
        //sec--2 (loop,0)
        for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        }
      
        //sec--3 (loop,-1.cal)
        //returnで初期に戻るので
        if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        }
            System.out.println(cal);
            return;
    }
  } import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
     
        //sec--1 (definition)
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long cal = 1;
        long max = (long)Math.pow(10,18);
      
        //sec--2 (loop,0)
        for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        }
      
        //sec--3 (loop,-1.cal)
        //returnで初期に戻るので
        if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        }
            System.out.println(cal);
            return;
    }
  } Main public static void main(String[] args) {
     
        //sec--1 (definition)
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long cal = 1;
        long max = (long)Math.pow(10,18);
      
        //sec--2 (loop,0)
        for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        }
      
        //sec--3 (loop,-1.cal)
        //returnで初期に戻るので
        if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        }
            System.out.println(cal);
            return;
    } main {
     
        //sec--1 (definition)
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long cal = 1;
        long max = (long)Math.pow(10,18);
      
        //sec--2 (loop,0)
        for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        }
      
        //sec--3 (loop,-1.cal)
        //returnで初期に戻るので
        if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        }
            System.out.println(cal);
            return;
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] A = new long[N]; A new long[N] N long cal = 1; cal 1 long max = (long)Math.pow(10,18); max (long)Math.pow(10,18) Math.pow Math 10 18 for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        } {
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        } A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc if(A[i]==0){
            System.out.println(0);
            return;
          } A[i]==0 A[i] A i 0 {
            System.out.println(0);
            return;
          } System.out.println(0) System.out.println System.out System System.out 0 return; if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        } cal != 0 cal 0 {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        } for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        } {
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        } if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          } max/cal < A[i] max/cal max cal A[i] A i {
            System.out.println(-1);
            return;
          } System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
            cal *= A[i];
          } cal *= A[i] cal A[i] A i System.out.println(cal) System.out.println System.out System System.out cal return; String[] args args public class Main {
    public static void main(String[] args) {
     
        //sec--1 (definition)
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long cal = 1;
        long max = (long)Math.pow(10,18);
      
        //sec--2 (loop,0)
        for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        }
      
        //sec--3 (loop,-1.cal)
        //returnで初期に戻るので
        if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        }
            System.out.println(cal);
            return;
    }
  } public class Main {
    public static void main(String[] args) {
     
        //sec--1 (definition)
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long cal = 1;
        long max = (long)Math.pow(10,18);
      
        //sec--2 (loop,0)
        for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        }
      
        //sec--3 (loop,-1.cal)
        //returnで初期に戻るので
        if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        }
            System.out.println(cal);
            return;
    }
  } Main
import java.util.*;
  public class Main {
    public static void main(String[] args) {
     
        //sec--1 (definition)
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] A = new long[N];
        long cal = 1;
        long max = (long)Math.pow(10,18);
      
        //sec--2 (loop,0)
        for(int i=0; i<N; i++){
          A[i] = sc.nextLong();
          if(A[i]==0){
            System.out.println(0);
            return;
          }
        }
      
        //sec--3 (loop,-1.cal)
        //returnで初期に戻るので
        if(cal != 0) {
        for(int i=0; i<N; i++){
          if(max/cal < A[i]){
            System.out.println(-1);
            return;
          } else {
            cal *= A[i];
          }
        }
        }
            System.out.println(cal);
            return;
    }
  }