import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		long max = 1000000000000000000l;
		// System.out.println(max);
		List<Long> arr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		}
		Collections.sort(arr);
		for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		}
		System.out.println(ans);
	}
}





 import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		long max = 1000000000000000000l;
		// System.out.println(max);
		List<Long> arr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		}
		Collections.sort(arr);
		for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		long max = 1000000000000000000l;
		// System.out.println(max);
		List<Long> arr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		}
		Collections.sort(arr);
		for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		long max = 1000000000000000000l;
		// System.out.println(max);
		List<Long> arr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		}
		Collections.sort(arr);
		for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		}
		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 ans = 1; ans 1 long max = 1000000000000000000l; max 1000000000000000000l List<Long> arr = new ArrayList<>(); arr new ArrayList<>() for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			arr.add(sc.nextLong());
		} {
			arr.add(sc.nextLong());
		} arr.add(sc.nextLong()) arr.add arr sc.nextLong() sc.nextLong sc Collections.sort(arr) Collections.sort Collections arr for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		} {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		} long a = arr.get(i); a arr.get(i) arr.get arr i if (a == 0) {
				ans = 0;
				break;
			} a == 0 a 0 {
				ans = 0;
				break;
			} ans = 0 ans 0 break; if (a > max) {
				ans = -1;
				break;
			} a > max a max {
				ans = -1;
				break;
			} ans = -1 ans -1 1 break; if (ans > max / a) {
				ans = -1;
				break;
			} ans > max / a ans max / a max a {
				ans = -1;
				break;
			} ans = -1 ans -1 1 break; ans *= arr.get(i) ans arr.get(i) arr.get arr i 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 ans = 1;
		long max = 1000000000000000000l;
		// System.out.println(max);
		List<Long> arr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		}
		Collections.sort(arr);
		for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		long max = 1000000000000000000l;
		// System.out.println(max);
		List<Long> arr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		}
		Collections.sort(arr);
		for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		}
		System.out.println(ans);
	}
} Main
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long ans = 1;
		long max = 1000000000000000000l;
		// System.out.println(max);
		List<Long> arr = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			arr.add(sc.nextLong());
		}
		Collections.sort(arr);
		for (int i = 0; i < n; i++) {
			long a = arr.get(i);
			if (a == 0) {
				ans = 0;
				break;
			}
			if (a > max) {
				ans = -1;
				break;
			}
			if (ans > max / a) {
				ans = -1;
				break;
			}
			ans *= arr.get(i);
		}
		System.out.println(ans);
	}
}






