import java.util.Arrays;
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];
		boolean isZero = false;
		for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		}
		sc.close();
		long ans = 1;
		long max = (long) Math.pow(10, 9);
		int count = 0;
		boolean isLarge = false;
		Arrays.sort(a);
		for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		}
		if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	}
} import java.util.Arrays; Arrays java.util 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];
		boolean isZero = false;
		for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		}
		sc.close();
		long ans = 1;
		long max = (long) Math.pow(10, 9);
		int count = 0;
		boolean isLarge = false;
		Arrays.sort(a);
		for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		}
		if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		boolean isZero = false;
		for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		}
		sc.close();
		long ans = 1;
		long max = (long) Math.pow(10, 9);
		int count = 0;
		boolean isLarge = false;
		Arrays.sort(a);
		for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		}
		if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		boolean isZero = false;
		for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		}
		sc.close();
		long ans = 1;
		long max = (long) Math.pow(10, 9);
		int count = 0;
		boolean isLarge = false;
		Arrays.sort(a);
		for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		}
		if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	} 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 boolean isZero = false; isZero false for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		} {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		} long tmp = sc.nextLong(); tmp sc.nextLong() sc.nextLong sc if (tmp == 0) {
				isZero = true;
				break;
			} tmp == 0 tmp 0 {
				isZero = true;
				break;
			} isZero = true isZero true break; a[i] = tmp a[i] a i tmp sc.close() sc.close sc long ans = 1; ans 1 long max = (long) Math.pow(10, 9); max (long) Math.pow(10, 9) Math.pow Math 10 9 int count = 0; count 0 boolean isLarge = false; isLarge false Arrays.sort(a) Arrays.sort Arrays a for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		} int i = n - 1; int i = n - 1; i n - 1 n 1 i >= 0 i 0 i-- i-- i {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		} {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		} ans *= a[i] ans a[i] a i if (a[i] > max) {
				count++;
			} a[i] > max a[i] a i max {
				count++;
			} count++ count if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			} count == 2 || ans > max * max count == 2 count 2 ans > max * max ans max * max max max {
				isLarge = true;
				break;
			} isLarge = true isLarge true break; if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		} isZero {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		} isLarge {
			System.out.println(-1);
		} System.out.println(-1) System.out.println System.out System System.out -1 1 {
			System.out.println(ans);
		} 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 sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		boolean isZero = false;
		for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		}
		sc.close();
		long ans = 1;
		long max = (long) Math.pow(10, 9);
		int count = 0;
		boolean isLarge = false;
		Arrays.sort(a);
		for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		}
		if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		boolean isZero = false;
		for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		}
		sc.close();
		long ans = 1;
		long max = (long) Math.pow(10, 9);
		int count = 0;
		boolean isLarge = false;
		Arrays.sort(a);
		for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		}
		if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	}
} Main
import java.util.Arrays;
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];
		boolean isZero = false;
		for (int i = 0; i < n; i++) {
			long tmp = sc.nextLong();
			if (tmp == 0) {
				isZero = true;
				break;
			}
			a[i] = tmp;

		}
		sc.close();
		long ans = 1;
		long max = (long) Math.pow(10, 9);
		int count = 0;
		boolean isLarge = false;
		Arrays.sort(a);
		for (int i = n - 1; i >= 0; i--) {
			ans *= a[i];
			if (a[i] > max) {
				count++;
			}
			if (count == 2 || ans > max * max) {
				isLarge = true;
				break;
			}
		}
		if (isZero) {
			System.out.println(0);
		} else if (isLarge) {
			System.out.println(-1);
		} else {
			System.out.println(ans);
		}
	}
}