import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		BigInteger[] a = new BigInteger[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		}
		sc.close();

		BigInteger lim = BigInteger.valueOf(1000000000000000000L);
		BigInteger ans = BigInteger.ONE;
		for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans.toString());
	}
} import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		BigInteger[] a = new BigInteger[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		}
		sc.close();

		BigInteger lim = BigInteger.valueOf(1000000000000000000L);
		BigInteger ans = BigInteger.ONE;
		for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans.toString());
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		BigInteger[] a = new BigInteger[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		}
		sc.close();

		BigInteger lim = BigInteger.valueOf(1000000000000000000L);
		BigInteger ans = BigInteger.ONE;
		for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans.toString());
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		BigInteger[] a = new BigInteger[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		}
		sc.close();

		BigInteger lim = BigInteger.valueOf(1000000000000000000L);
		BigInteger ans = BigInteger.ONE;
		for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans.toString());
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc BigInteger[] a = new BigInteger[n]; a new BigInteger[n] n for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		} {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		} a[i] = sc.nextBigInteger() a[i] a i sc.nextBigInteger() sc.nextBigInteger sc if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			} a[i].compareTo(BigInteger.ZERO) == 0 a[i].compareTo(BigInteger.ZERO) a[i].compareTo a[i] a i BigInteger.ZERO BigInteger BigInteger.ZERO 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; sc.close() sc.close sc BigInteger lim = BigInteger.valueOf(1000000000000000000L); lim BigInteger.valueOf(1000000000000000000L) BigInteger.valueOf BigInteger 1000000000000000000L BigInteger ans = BigInteger.ONE; ans BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		} {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		} ans = ans.multiply(a[i]) ans ans.multiply(a[i]) ans.multiply ans a[i] a i if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			} ans.compareTo(lim) > 0 ans.compareTo(lim) ans.compareTo ans lim 0 {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(ans.toString()) System.out.println System.out System System.out ans.toString() ans.toString ans String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		BigInteger[] a = new BigInteger[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		}
		sc.close();

		BigInteger lim = BigInteger.valueOf(1000000000000000000L);
		BigInteger ans = BigInteger.ONE;
		for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans.toString());
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		BigInteger[] a = new BigInteger[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		}
		sc.close();

		BigInteger lim = BigInteger.valueOf(1000000000000000000L);
		BigInteger ans = BigInteger.ONE;
		for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans.toString());
	}
} Main
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		BigInteger[] a = new BigInteger[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextBigInteger();
			if (a[i].compareTo(BigInteger.ZERO) == 0) {
				System.out.println(0);
				return;
			}
		}
		sc.close();

		BigInteger lim = BigInteger.valueOf(1000000000000000000L);
		BigInteger ans = BigInteger.ONE;
		for (int i = 0; i < n; i++) {
			ans = ans.multiply(a[i]);
			if (ans.compareTo(lim) > 0) {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(ans.toString());
	}
}
