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