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];
		long v = 1;
		boolean zeroFlg = false;

		long max = (long) Math.pow(10, 18);
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		}
		if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		}
		System.out.println(v);
	}
} 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];
		long v = 1;
		boolean zeroFlg = false;

		long max = (long) Math.pow(10, 18);
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		}
		if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		}
		System.out.println(v);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		long[] a = new long[n];
		long v = 1;
		boolean zeroFlg = false;

		long max = (long) Math.pow(10, 18);
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		}
		if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		}
		System.out.println(v);
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		long[] a = new long[n];
		long v = 1;
		boolean zeroFlg = false;

		long max = (long) Math.pow(10, 18);
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		}
		if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		}
		System.out.println(v);
	} 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 long v = 1; v 1 boolean zeroFlg = false; zeroFlg false long max = (long) Math.pow(10, 18); max (long) Math.pow(10, 18) Math.pow Math 10 18 for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		} {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		} a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if (a[i] == 0) {
				zeroFlg = true;
				break;
			} a[i] == 0 a[i] a i 0 {
				zeroFlg = true;
				break;
			} zeroFlg = true zeroFlg true break; if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		} zeroFlg {
			v = 0;
		} v = 0 v 0 {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		} for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			} long a1 a {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			} {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			} if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				} max / v >= a1 max / v max v a1 {
					v *= a1;
				} v *= a1 v a1 {
					v = -1;
					break;
				} v = -1 v -1 1 break; System.out.println(v) System.out.println System.out System System.out v 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];
		long v = 1;
		boolean zeroFlg = false;

		long max = (long) Math.pow(10, 18);
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		}
		if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		}
		System.out.println(v);
	}
} public class Main {

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

		int n = sc.nextInt();
		long[] a = new long[n];
		long v = 1;
		boolean zeroFlg = false;

		long max = (long) Math.pow(10, 18);
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		}
		if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		}
		System.out.println(v);
	}
} 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];
		long v = 1;
		boolean zeroFlg = false;

		long max = (long) Math.pow(10, 18);
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				zeroFlg = true;
				break;
			}
		}
		if (zeroFlg) {
			v = 0;
		} else {
			for (long a1 : a) {
				if (max / v >= a1) {
					v *= a1;
				} else {
					v = -1;
					break;
				}
			}
		}
		System.out.println(v);
	}
}