import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long total = 1;
		long input[] = new long[N];
		for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		}
		if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		}
		System.out.println(total);
	}
} 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 total = 1;
		long input[] = new long[N];
		for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		}
		if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		}
		System.out.println(total);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long total = 1;
		long input[] = new long[N];
		for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		}
		if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		}
		System.out.println(total);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long total = 1;
		long input[] = new long[N];
		for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		}
		if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		}
		System.out.println(total);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long total = 1; total 1 long input[] = new long[N]; input new long[N] N for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		} {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		} input[i] = sc.nextLong() input[i] input i sc.nextLong() sc.nextLong sc if (input[i] == 0) {
				total = 0;
				break;
			} input[i] == 0 input[i] input i 0 {
				total = 0;
				break;
			} total = 0 total 0 break; if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		} total != 0 total 0 {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		} for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			} {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			} if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				} input[i] > 1000000000000000000L / total input[i] input i 1000000000000000000L / total 1000000000000000000L total {
					total = -1;
					break;
				} total = -1 total -1 1 break; total *= input[i] total input[i] input i System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long total = 1;
		long input[] = new long[N];
		for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		}
		if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		}
		System.out.println(total);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long total = 1;
		long input[] = new long[N];
		for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		}
		if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		}
		System.out.println(total);
	}
} 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 total = 1;
		long input[] = new long[N];
		for (int i = 0; i < N; i++) {
			input[i] = sc.nextLong();
			if (input[i] == 0) {
				total = 0;
				break;
			}
		}
		if (total != 0) {
			for (int i = 0; i < N; i++) {
				if (input[i] > 1000000000000000000L / total) {
					total = -1;
					break;
				}
				total *= input[i];
			}
		}
		System.out.println(total);
	}
}