import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		long A[] = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		}

		long ans = A[0];
		for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		}

		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		long A[] = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		}

		long ans = A[0];
		for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		}

		System.out.println(ans);
	}

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		long A[] = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		}

		long ans = A[0];
		for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		}

		System.out.println(ans);
	} main {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		long A[] = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		}

		long ans = A[0];
		for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		}

		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan long A[] = new long[N]; A new long[N] N for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		} {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		} A[i] = scan.nextLong() A[i] A i scan.nextLong() scan.nextLong scan if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			} A[i] == 0 A[i] A i 0 {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; long ans = A[0]; ans A[0] A 0 for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		} {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		} if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			} A[i] <= (1000000000000000000L / ans) A[i] A i (1000000000000000000L / ans) 1000000000000000000L ans {
				ans *= A[i];
			} ans *= A[i] ans A[i] A i {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		long A[] = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		}

		long ans = A[0];
		for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		}

		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		long A[] = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		}

		long ans = A[0];
		for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		}

		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		long A[] = new long[N];

		for (int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
			if (A[i] == 0) {
				// 0が含まれてたら終了
				System.out.println(0);
				return;
			}
		}

		long ans = A[0];
		for (int i = 1; i < N; i++) {
			if (A[i] <= (1000000000000000000L / ans)) {
				ans *= A[i];
			} else {
				// 10の18乗超えた
				System.out.println(-1);
				return;
			}
		}

		System.out.println(ans);
	}

}