import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		long ans=1;
		int flag=0;
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		}
		if(flag==1)
		{
			ans=-1;
		}
		System.out.println(ans);
	}
}
	 import java.util.*; util.* java import java.io.*; io.* java public class Main
{
	public static void main(String [] Args)
	{
		long ans=1;
		int flag=0;
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		}
		if(flag==1)
		{
			ans=-1;
		}
		System.out.println(ans);
	}
} Main public static void main(String [] Args)
	{
		long ans=1;
		int flag=0;
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		}
		if(flag==1)
		{
			ans=-1;
		}
		System.out.println(ans);
	} main {
		long ans=1;
		int flag=0;
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		}
		if(flag==1)
		{
			ans=-1;
		}
		System.out.println(ans);
	} long ans=1; ans 1 int flag=0; flag 0 Scanner in = new Scanner(System.in); in new Scanner(System.in) int n=in.nextInt(); n in.nextInt() in.nextInt in for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		} {
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		} long a=in.nextLong(); a in.nextLong() in.nextLong in if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			} a==0 a 0 {
				flag=-1;
				ans=ans*a;
				break;
			} flag=-1 flag -1 1 ans=ans*a ans ans*a ans a break; if(ans>(long)1e18/a)
			{
				flag=1;
			} ans>(long)1e18/a ans (long)1e18/a (long)1e18 a {
				flag=1;
			} flag=1 flag 1 ans=ans*a ans ans*a ans a if(flag==1)
		{
			ans=-1;
		} flag==1 flag 1 {
			ans=-1;
		} ans=-1 ans -1 1 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)
	{
		long ans=1;
		int flag=0;
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		}
		if(flag==1)
		{
			ans=-1;
		}
		System.out.println(ans);
	}
} public class Main
{
	public static void main(String [] Args)
	{
		long ans=1;
		int flag=0;
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		}
		if(flag==1)
		{
			ans=-1;
		}
		System.out.println(ans);
	}
} Main
import java.util.*;
import java.io.*;

public class Main
{
	public static void main(String [] Args)
	{
		long ans=1;
		int flag=0;
		Scanner in = new Scanner(System.in);
		int n=in.nextInt();
		for(int i=0;i<n;i++)
		{
			long a=in.nextLong();
			if(a==0)
			{
				flag=-1;
				ans=ans*a;
				break;
			}			
			if(ans>(long)1e18/a)
			{
				flag=1;
			}
			ans=ans*a;
		}
		if(flag==1)
		{
			ans=-1;
		}
		System.out.println(ans);
	}
}
	