
import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

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

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	}

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

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

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

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	}

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

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

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

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	} main {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

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

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc long a[]; a a = new long[n] a new long[n] n for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(sc.next());
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = Long.parseLong(sc.next());
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		} {
			a[i] = Long.parseLong(sc.next());
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		} a[i] = Long.parseLong(sc.next()) a[i] a i Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if (a[i] == 0) {
				System.out.println(0);
				return;
			} a[i] == 0 a[i] a i 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; long result = 1; result 1 long limit = 1000000000000000000L; limit 1000000000000000000L for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			} result <= limit / a[i] result limit / a[i] limit a[i] a i {
				result = result * a[i];
			} result = result * a[i] result result * a[i] result a[i] a i {
				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 {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

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

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

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

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	}

} Main

import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());

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

		long result = 1;
		long limit = 1000000000000000000L;
		for (int i = 0; i < n; i++) {

			if (result <= limit / a[i]) {
				result = result * a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}

		System.out.println(result);

	}

}