import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		long sum = 1;
		long max = (long) Math.pow(10, 18);

		if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		}
			scan.close();
			System.out.println(sum);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		long sum = 1;
		long max = (long) Math.pow(10, 18);

		if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		}
			scan.close();
			System.out.println(sum);
	}
} Main public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		long sum = 1;
		long max = (long) Math.pow(10, 18);

		if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		}
			scan.close();
			System.out.println(sum);
	} main {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		long sum = 1;
		long max = (long) Math.pow(10, 18);

		if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		}
			scan.close();
			System.out.println(sum);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int count = scan.nextInt(); count scan.nextInt() scan.nextInt scan long sum = 1; sum 1 long max = (long) Math.pow(10, 18); max (long) Math.pow(10, 18) Math.pow Math 10 18 if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		} count >= 2 count 2 {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		} for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			} int i = 0 ; int i = 0 ; i 0 i < count i count i++ i++ i {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			} {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			} long value = scan.nextLong(); value scan.nextLong() scan.nextLong scan if (value == 0) {
					sum = 0;
					break;
				} value == 0 value 0 {
					sum = 0;
					break;
				} sum = 0 sum 0 break; if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1; sum != -1 && sum <= max / value sum != -1 sum -1 1 sum <= max / value sum max / value max value {
					sum *= value;
				} sum *= value sum value sum = -1 sum -1 1 scan.close() scan.close scan System.out.println(sum) System.out.println System.out System System.out sum String args[] args public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		long sum = 1;
		long max = (long) Math.pow(10, 18);

		if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		}
			scan.close();
			System.out.println(sum);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		long sum = 1;
		long max = (long) Math.pow(10, 18);

		if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		}
			scan.close();
			System.out.println(sum);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		long sum = 1;
		long max = (long) Math.pow(10, 18);

		if (count >= 2) {
			for (int i = 0 ; i < count ; i++) {
				long value = scan.nextLong();
				if (value == 0) {
					sum = 0;
					break;
				}
				if (sum != -1 && sum <= max / value) {
					sum *= value;
				}
				else sum = -1;
			}
		}
			scan.close();
			System.out.println(sum);
	}
}