import java.math.BigDecimal;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String str = sc.nextLine();
		long b = 0;
		long ans = 1;
		long  c = (long)Math.pow(10, 18);
		for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		}
		sc.close();

		System.out.println(ans);
	}
}

 import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String str = sc.nextLine();
		long b = 0;
		long ans = 1;
		long  c = (long)Math.pow(10, 18);
		for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		}
		sc.close();

		System.out.println(ans);
	}
} Main public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String str = sc.nextLine();
		long b = 0;
		long ans = 1;
		long  c = (long)Math.pow(10, 18);
		for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		}
		sc.close();

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String str = sc.nextLine();
		long b = 0;
		long ans = 1;
		long  c = (long)Math.pow(10, 18);
		for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		}
		sc.close();

		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 String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc long b = 0; b 0 long ans = 1; ans 1 long  c = (long)Math.pow(10, 18); c (long)Math.pow(10, 18) Math.pow Math 10 18 for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		} {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		} b = sc.nextLong() b sc.nextLong() sc.nextLong sc if (b == 0) {
				ans = 0;
				break;
			} b == 0 b 0 {
				ans = 0;
				break;
			} ans = 0 ans 0 break; long ans2 = Long.MAX_VALUE; ans2 Long.MAX_VALUE Long Long.MAX_VALUE if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			} new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1 new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo new BigDecimal(ans).multiply(new BigDecimal(b)) new BigDecimal(ans).multiply new BigDecimal(ans) new BigDecimal(b) new BigDecimal(ans2) -1 1 {
				ans *= b ;
			} ans *= b ans b {
				ans = ans2;
			} ans = ans2 ans ans2 if (ans > c || ans < 0) {
				ans = -1;
			} ans > c || ans < 0 ans > c ans c ans < 0 ans 0 {
				ans = -1;
			} ans = -1 ans -1 1 sc.close() sc.close sc 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();
		String str = sc.nextLine();
		long b = 0;
		long ans = 1;
		long  c = (long)Math.pow(10, 18);
		for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		}
		sc.close();

		System.out.println(ans);
	}
} public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String str = sc.nextLine();
		long b = 0;
		long ans = 1;
		long  c = (long)Math.pow(10, 18);
		for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		}
		sc.close();

		System.out.println(ans);
	}
} Main
import java.math.BigDecimal;
import java.util.Scanner;

public class Main
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String str = sc.nextLine();
		long b = 0;
		long ans = 1;
		long  c = (long)Math.pow(10, 18);
		for (int i=0; i<n; i++) {
			b = sc.nextLong();
			if (b == 0) {
				ans = 0;
				break;
			}
			long ans2 = Long.MAX_VALUE;
			if(new BigDecimal(ans).multiply(new BigDecimal(b)).compareTo(new BigDecimal(ans2)) == -1) {
				ans *= b ;
			} else {
				ans = ans2;
			}
			if (ans > c || ans < 0) {
				ans = -1;
			}
		}
		sc.close();

		System.out.println(ans);
	}
}


