import java.util.*;

class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
      int N =sc.nextInt();
      long A[] = new long[N];
      for(int i=0;i<N;i++){
        A[i] = sc.nextLong();
      }
      Arrays.sort(A);
      long ans = 1;
      for(int i=0;i<N;i++){
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      }
      System.out.println(ans);
	}
} import java.util.*; util.* java class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
      int N =sc.nextInt();
      long A[] = new long[N];
      for(int i=0;i<N;i++){
        A[i] = sc.nextLong();
      }
      Arrays.sort(A);
      long ans = 1;
      for(int i=0;i<N;i++){
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      }
      System.out.println(ans);
	}
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
      int N =sc.nextInt();
      long A[] = new long[N];
      for(int i=0;i<N;i++){
        A[i] = sc.nextLong();
      }
      Arrays.sort(A);
      long ans = 1;
      for(int i=0;i<N;i++){
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      }
      System.out.println(ans);
	} main {
      int N =sc.nextInt();
      long A[] = new long[N];
      for(int i=0;i<N;i++){
        A[i] = sc.nextLong();
      }
      Arrays.sort(A);
      long ans = 1;
      for(int i=0;i<N;i++){
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      }
      System.out.println(ans);
	} int N =sc.nextInt(); N sc.nextInt() sc.nextInt sc long A[] = new long[N]; A new long[N] N for(int i=0;i<N;i++){
        A[i] = sc.nextLong();
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        A[i] = sc.nextLong();
      } {
        A[i] = sc.nextLong();
      } A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc Arrays.sort(A) Arrays.sort Arrays A long ans = 1; ans 1 for(int i=0;i<N;i++){
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      } {
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      } if(ans==0) break; ans==0 ans 0 break; if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        } A[i]>(long)Math.pow(10,18)/ans A[i] A i (long)Math.pow(10,18)/ans (long)Math.pow(10,18) Math.pow Math 10 18 ans {
          ans = -1;
          break;
        } ans = -1 ans -1 1 break; ans*=A[i] ans A[i] A i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
      int N =sc.nextInt();
      long A[] = new long[N];
      for(int i=0;i<N;i++){
        A[i] = sc.nextLong();
      }
      Arrays.sort(A);
      long ans = 1;
      for(int i=0;i<N;i++){
        if(ans==0) break;
        if(A[i]>(long)Math.pow(10,18)/ans){
          ans = -1;
          break;
        }
        ans*=A[i];
      }
      System.out.println(ans);
	}
}