import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 入力値の取得
		int N = sc.nextInt();
		long[] A = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		}

		long product = 1;
		for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		}

		// 結果の出力
		System.out.println(product);

		sc.close();
	}
} 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();
		long[] A = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		}

		long product = 1;
		for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		}

		// 結果の出力
		System.out.println(product);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 入力値の取得
		int N = sc.nextInt();
		long[] A = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		}

		long product = 1;
		for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		}

		// 結果の出力
		System.out.println(product);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);

		// 入力値の取得
		int N = sc.nextInt();
		long[] A = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		}

		long product = 1;
		for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		}

		// 結果の出力
		System.out.println(product);

		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] A = new long[N]; A new long[N] N for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		} {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		} A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			} A[i] == 0 A[i] A i 0 {
				System.out.println(0);
				sc.close();
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 sc.close() sc.close sc return; long product = 1; product 1 for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		} long a A {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		} {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		} try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			} Exception e {
				System.out.println(-1);
				sc.close();
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 sc.close() sc.close sc return; {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} product = Math.multiplyExact(product, a) product Math.multiplyExact(product, a) Math.multiplyExact Math product a if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				} product > (long) Math.pow(10, 18) product (long) Math.pow(10, 18) Math.pow Math 10 18 {
					System.out.println(-1);
					sc.close();
					return;
				} System.out.println(-1) System.out.println System.out System System.out -1 1 sc.close() sc.close sc return; System.out.println(product) System.out.println System.out System System.out product 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();
		long[] A = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		}

		long product = 1;
		for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		}

		// 結果の出力
		System.out.println(product);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 入力値の取得
		int N = sc.nextInt();
		long[] A = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		}

		long product = 1;
		for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		}

		// 結果の出力
		System.out.println(product);

		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		// 入力値の取得
		int N = sc.nextInt();
		long[] A = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if (A[i] == 0) {
				System.out.println(0);
				sc.close();
				return;
			}
		}

		long product = 1;
		for (long a : A) {
			try {
				product = Math.multiplyExact(product, a);

				if (product > (long) Math.pow(10, 18)) {
					System.out.println(-1);
					sc.close();
					return;
				}
			} catch (Exception e) {
				System.out.println(-1);
				sc.close();
				return;
			}
		}

		// 結果の出力
		System.out.println(product);

		sc.close();
	}
}
