/******************************************************************************

                            Online Java Compiler.
                Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.

*******************************************************************************/
import java.util.*;
import java.math.*;
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 ans = 1;
		int i,k=0;
		for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		}
		if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		}
	}
} import java.util.*; util.* java import java.math.*; math.* 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 ans = 1;
		int i,k=0;
		for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		}
		if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long []a = new long[n];
		long ans = 1;
		int i,k=0;
		for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		}
		if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long []a = new long[n];
		long ans = 1;
		int i,k=0;
		for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		}
		if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		}
	} 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 ans = 1; ans 1 int i i k=0; k 0 for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		} i=0; i=0 i 0 i<n i n i++ i++ i {
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		} {
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		} a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i] == 0)
		        k = 1; a[i] == 0 a[i] a i 0 k = 1 k 1 if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		} k == 1 k 1 {
		    System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		} BigInteger b = new BigInteger("10"); b new BigInteger("10") int ex = 18; ex 18 b = b.pow(ex) b b.pow(ex) b.pow b ex int p = 0; p 0 BigInteger f = new BigInteger("1"); f new BigInteger("1") for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		} i=0; i=0 i 0 i<n i n i++ i++ i {
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		} {
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		} long x = a[i]; x a[i] a i f = f.multiply(BigInteger.valueOf(x)) f f.multiply(BigInteger.valueOf(x)) f.multiply f BigInteger.valueOf(x) BigInteger.valueOf BigInteger x int com = f.compareTo(b); com f.compareTo(b) f.compareTo f b if(com == 1)
		    {
		        p = 1;
		        break;
		    } com == 1 com 1 {
		        p = 1;
		        break;
		    } p = 1 p 1 break; if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f); p == 1 p 1 System.out.println("-1") System.out.println System.out System System.out "-1" System.out.println(f) System.out.println System.out System System.out f 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 ans = 1;
		int i,k=0;
		for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		}
		if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		}
	}
} 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 ans = 1;
		int i,k=0;
		for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		}
		if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		}
	}
} Main
/******************************************************************************

                            Online Java Compiler.
                Code, Compile, Run and Debug java program online.
Write your code in this editor and press "Run" button to execute it.

*******************************************************************************/
import java.util.*;
import java.math.*;
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 ans = 1;
		int i,k=0;
		for(i=0; i<n; i++)
		{
		    a[i] = sc.nextLong();
		    if(a[i] == 0)
		        k = 1;
		}
		if(k == 1)
		{
		    System.out.println(0);
		}
		else
		{
		    
		BigInteger b = new BigInteger("10");
		int ex = 18;
		b = b.pow(ex);
		int p = 0;
		BigInteger f = new BigInteger("1");
		for(i=0; i<n; i++)
		{
		    long x = a[i];
		    f = f.multiply(BigInteger.valueOf(x));
		    int com = f.compareTo(b);
		    if(com == 1)
		    {
		        p = 1;
		        break;
		    }
		    
		}
	    if(p == 1)
	        System.out.println("-1");
	    else
	        System.out.println(f);
		}
	}
}
