import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	private static long max = (long) Math.pow(10.0, 18.0);

	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++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		}
		sc.close();

		long result = 1L;
		for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(result);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

	private static long max = (long) Math.pow(10.0, 18.0);

	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++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		}
		sc.close();

		long result = 1L;
		for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(result);
	}
} Main private static long max = (long) Math.pow(10.0, 18.0); max (long) Math.pow(10.0, 18.0) Math.pow Math 10.0 18.0 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++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		}
		sc.close();

		long result = 1L;
		for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		}
		sc.close();

		long result = 1L;
		for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(result);
	} 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++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		} {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		} long next = sc.nextLong(); next sc.nextLong() sc.nextLong sc if (next == 0) {
				System.out.println(0);
				return;
			} next == 0 next 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; a[i] = next a[i] a i next sc.close() sc.close sc long result = 1L; result 1L for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		} {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		} try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			} ArithmeticException e {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
				result = Math.multiplyExact(result, a[i]);
			} result = Math.multiplyExact(result, a[i]) result Math.multiplyExact(result, a[i]) Math.multiplyExact Math result a[i] a i if (result > max) {
				System.out.println(-1);
				return;
			} result > max result max {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	private static long max = (long) Math.pow(10.0, 18.0);

	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++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		}
		sc.close();

		long result = 1L;
		for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(result);
	}
} public class Main {

	private static long max = (long) Math.pow(10.0, 18.0);

	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++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		}
		sc.close();

		long result = 1L;
		for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(result);
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	private static long max = (long) Math.pow(10.0, 18.0);

	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++) {
			long next = sc.nextLong();
			if (next == 0) {
				System.out.println(0);
				return;
			}
			a[i] = next;
		}
		sc.close();

		long result = 1L;
		for (int i = 0; i < n; i++) {
			try {
				result = Math.multiplyExact(result, a[i]);
			} catch (ArithmeticException e) {
				System.out.println(-1);
				return;
			}
			if (result > max) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(result);
	}
}
