import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static long max = 1000000000000000000L;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		sc.close();

	}
} import java.math.BigInteger; BigInteger java.math import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	static long max = 1000000000000000000L;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		sc.close();

	}
} Main static long max = 1000000000000000000L; max 1000000000000000000L public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String eatEmpty = sc.nextLine(); eatEmpty sc.nextLine() sc.nextLine sc String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc String tempInput = " " + input + " "; tempInput " " + input + " " " " + input + " " " " input " " if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		} tempInput.contains(" 0 ") tempInput.contains tempInput " 0 " System.out.println(0) System.out.println System.out System System.out 0 {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		} String nums[] = input.split(" "); nums input.split(" ") input.split input " " double logAns = 0; logAns 0 long ans = 1; ans 1 while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			} --N >= 0 --N N 0 {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			} long temp = Long.parseLong(nums[N]); temp Long.parseLong(nums[N]) Long.parseLong Long nums[N] nums N logAns += Math.log10(temp) logAns Math.log10(temp) Math.log10 Math temp ans *= temp ans temp if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans); logAns > 18.1 || ans > max || ans <= 0 logAns > 18.1 || ans > max || ans <= 0 logAns > 18.1 logAns 18.1 ans > max ans max ans <= 0 ans 0 System.out.println(-1) System.out.println System.out System System.out -1 1 System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {
	static long max = 1000000000000000000L;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		sc.close();

	}
} public class Main {
	static long max = 1000000000000000000L;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		sc.close();

	}
} Main
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static long max = 1000000000000000000L;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 "))
			System.out.println(0);
		else {
			String nums[] = input.split(" ");
			double logAns = 0;
			long ans = 1;
			while (--N >= 0) {
				long temp = Long.parseLong(nums[N]);
				logAns += Math.log10(temp);
				ans *= temp;
			}
//			System.out.println(logAns + " " + ans + " " + max);
			if (logAns > 18.1 || ans > max || ans <= 0)
				System.out.println(-1);
			else
				System.out.println(ans);
		}
		sc.close();

	}
}
