import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		long[] arr = new long[(int) N];
		int zero = 0;
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		}
		if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		}
	}

	public static boolean checklong(long a, long b) {
		long c = a * b;
		if ((c / (a)) == b) {
			return true;
		}
		return false;
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		long[] arr = new long[(int) N];
		int zero = 0;
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		}
		if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		}
	}

	public static boolean checklong(long a, long b) {
		long c = a * b;
		if ((c / (a)) == b) {
			return true;
		}
		return false;
	}
} Main public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		long[] arr = new long[(int) N];
		int zero = 0;
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		}
		if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		}
	} main {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		long[] arr = new long[(int) N];
		int zero = 0;
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		}
		if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		}
	} Scanner scn = new Scanner(System.in); scn new Scanner(System.in) long N = scn.nextInt(); N scn.nextInt() scn.nextInt scn long[] arr = new long[(int) N]; arr new long[(int) N] (int) N int zero = 0; zero 0 for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		} {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		} arr[i] = scn.nextLong() arr[i] arr i scn.nextLong() scn.nextLong scn if (arr[i] == 0) {
				zero++;
			} arr[i] == 0 arr[i] arr i 0 {
				zero++;
			} zero++ zero if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		} zero != 0 zero 0 {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		} long ans = 1; ans 1 boolean check = true; check true for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			} {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			} if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				} checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L checklong(ans, arr[i]) checklong ans arr[i] arr i ans * arr[i] <= 1000000000000000000L ans * arr[i] ans arr[i] arr i 1000000000000000000L {
					ans = ans * arr[i];
				} ans = ans * arr[i] ans ans * arr[i] ans arr[i] arr i {
					check = false;
					System.out.println(-1);
					break;
				} check = false check false System.out.println(-1) System.out.println System.out System System.out -1 1 break; if (check) {
				System.out.println(ans);
			} check {
				System.out.println(ans);
			} System.out.println(ans) System.out.println System.out System System.out ans String[] args args public static boolean checklong(long a, long b) {
		long c = a * b;
		if ((c / (a)) == b) {
			return true;
		}
		return false;
	} checklong {
		long c = a * b;
		if ((c / (a)) == b) {
			return true;
		}
		return false;
	} long c = a * b; c a * b a b if ((c / (a)) == b) {
			return true;
		} (c / (a)) == b (c / (a)) c (a) b {
			return true;
		} return true; true return false; false long a a long b b public class Main{
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		long[] arr = new long[(int) N];
		int zero = 0;
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		}
		if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		}
	}

	public static boolean checklong(long a, long b) {
		long c = a * b;
		if ((c / (a)) == b) {
			return true;
		}
		return false;
	}
} public class Main{
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		long[] arr = new long[(int) N];
		int zero = 0;
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		}
		if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		}
	}

	public static boolean checklong(long a, long b) {
		long c = a * b;
		if ((c / (a)) == b) {
			return true;
		}
		return false;
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		long N = scn.nextInt();
		long[] arr = new long[(int) N];
		int zero = 0;
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextLong();
			if (arr[i] == 0) {
				zero++;
			}
		}
		if (zero != 0) {
			System.out.println(0);
		} else {
			long ans = 1;
			boolean check = true;
			for (int i = 0; i < N; i++) {
				if (checklong(ans, arr[i]) && ans * arr[i] <= 1000000000000000000L) {
					ans = ans * arr[i];
				} else {
					check = false;
					System.out.println(-1);
					break;
				}
			}
			if (check) {
				System.out.println(ans);
			}
		}
	}

	public static boolean checklong(long a, long b) {
		long c = a * b;
		if ((c / (a)) == b) {
			return true;
		}
		return false;
	}
}