import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
      int N=sc.nextInt();
      long[] a=new long[N];
      long x=1;
      for(int i=0;i<N;i++){
      	a[i]=sc.nextLong();
       if(a[i]==0){
       	System.out.println(0);
         return;
       }
      }
      for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      }
      if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        return;
      }
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
      int N=sc.nextInt();
      long[] a=new long[N];
      long x=1;
      for(int i=0;i<N;i++){
      	a[i]=sc.nextLong();
       if(a[i]==0){
       	System.out.println(0);
         return;
       }
      }
      for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      }
      if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        return;
      }
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
      int N=sc.nextInt();
      long[] a=new long[N];
      long x=1;
      for(int i=0;i<N;i++){
      	a[i]=sc.nextLong();
       if(a[i]==0){
       	System.out.println(0);
         return;
       }
      }
      for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      }
      if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        return;
      }
	} main {
		Scanner sc=new Scanner(System.in);
      int N=sc.nextInt();
      long[] a=new long[N];
      long x=1;
      for(int i=0;i<N;i++){
      	a[i]=sc.nextLong();
       if(a[i]==0){
       	System.out.println(0);
         return;
       }
      }
      for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      }
      if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        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 x=1; x 1 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; for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      } {
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      } if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       } a[i]<=1000000000000000000L/x a[i] a i 1000000000000000000L/x 1000000000000000000L x {
       	x=x*a[i];
       } x=x*a[i] x x*a[i] x a[i] a i {
       	System.out.println(-1);
         return;
       } System.out.println(-1) System.out.println System.out System System.out -1 1 return; if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        return;
      } x<=1000000000000000000L x 1000000000000000000L {
      	System.out.println(x);
        return;
      } System.out.println(x) System.out.println System.out System System.out x return; {
      	System.out.println(-1);
        return;
      } System.out.println(-1) System.out.println System.out System System.out -1 1 return; String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
      int N=sc.nextInt();
      long[] a=new long[N];
      long x=1;
      for(int i=0;i<N;i++){
      	a[i]=sc.nextLong();
       if(a[i]==0){
       	System.out.println(0);
         return;
       }
      }
      for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      }
      if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        return;
      }
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
      int N=sc.nextInt();
      long[] a=new long[N];
      long x=1;
      for(int i=0;i<N;i++){
      	a[i]=sc.nextLong();
       if(a[i]==0){
       	System.out.println(0);
         return;
       }
      }
      for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      }
      if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        return;
      }
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
      int N=sc.nextInt();
      long[] a=new long[N];
      long x=1;
      for(int i=0;i<N;i++){
      	a[i]=sc.nextLong();
       if(a[i]==0){
       	System.out.println(0);
         return;
       }
      }
      for(int i=0;i<N;i++){
      	if(a[i]<=1000000000000000000L/x){
       	x=x*a[i];
       }else{
       	System.out.println(-1);
         return;
       }
      }
      if(x<=1000000000000000000L){
      	System.out.println(x);
        return;
      }else{
      	System.out.println(-1);
        return;
      }
	}
}