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

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		BigInteger max = new BigInteger((long) Math.pow(10, 18) + "");
		int flag = 0;
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : 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 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		BigInteger max = new BigInteger((long) Math.pow(10, 18) + "");
		int flag = 0;
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		}
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		BigInteger max = new BigInteger((long) Math.pow(10, 18) + "");
		int flag = 0;
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		BigInteger max = new BigInteger((long) Math.pow(10, 18) + "");
		int flag = 0;
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc BigInteger ans = new BigInteger("1"); ans new BigInteger("1") BigInteger max = new BigInteger((long) Math.pow(10, 18) + ""); max new BigInteger((long) Math.pow(10, 18) + "") int flag = 0; flag 0 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 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		} tempInput.contains(" 0 ") tempInput.contains tempInput " 0 " {
			flag = 1;
			System.out.println(0);
		} flag = 1 flag 1 System.out.println(0) System.out.println System.out System System.out 0 {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		} String nums[] = input.split(" "); nums input.split(" ") input.split input " " while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			} --N >= 0 --N N 0 {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			} if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				} flag == 0 && max.compareTo(ans) >= 0 flag == 0 flag 0 max.compareTo(ans) >= 0 max.compareTo(ans) max.compareTo max ans 0 {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} BigInteger a = new BigInteger(nums[N]); a new BigInteger(nums[N]) ans = ans.multiply(a) ans ans.multiply(a) ans.multiply ans a if (flag == 0) {
					flag = 1;
					break;
				} flag == 0 flag 0 {
					flag = 1;
					break;
				} flag = 1 flag 1 break; System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans) System.out.println System.out System System.out (flag == 1 || max.compareTo(ans) < 0) ? -1 : ans (flag == 1 || max.compareTo(ans) < 0) flag == 1 flag 1 max.compareTo(ans) < 0 max.compareTo(ans) max.compareTo max ans 0 -1 1 ans sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		BigInteger max = new BigInteger((long) Math.pow(10, 18) + "");
		int flag = 0;
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		}
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		BigInteger max = new BigInteger((long) Math.pow(10, 18) + "");
		int flag = 0;
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		}
		sc.close();
	}
} Main
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		BigInteger max = new BigInteger((long) Math.pow(10, 18) + "");
		int flag = 0;
		String eatEmpty = sc.nextLine();
		String input = sc.nextLine();
		String tempInput = " " + input + " ";
		if (tempInput.contains(" 0 ")) {
			flag = 1;
			System.out.println(0);
		} else {
			String nums[] = input.split(" ");
//			System.out.println(Arrays.toString(nums));
			while (--N >= 0) {
				if (flag == 0 && max.compareTo(ans) >= 0) {
					BigInteger a = new BigInteger(nums[N]);
					ans = ans.multiply(a);
				} else if (flag == 0) {
					flag = 1;
					break;
				}
			}
			System.out.println((flag == 1 || max.compareTo(ans) < 0) ? -1 : ans);
		}
		sc.close();
	}
}
