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];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		}
		sc.close();
		Arrays.sort(A);
		// 0があるなら答えは必ず0
		if(A[0] == 0) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} 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];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		}
		sc.close();
		Arrays.sort(A);
		// 0があるなら答えは必ず0
		if(A[0] == 0) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		}
		sc.close();
		Arrays.sort(A);
		// 0があるなら答えは必ず0
		if(A[0] == 0) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		}
		sc.close();
		Arrays.sort(A);
		// 0があるなら答えは必ず0
		if(A[0] == 0) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	} 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 for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = sc.nextLong();
		} {
			A[i] = sc.nextLong();
		} A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc sc.close() sc.close sc Arrays.sort(A) Arrays.sort Arrays A if(A[0] == 0) {
			prtln(0);
			return;
		} A[0] == 0 A[0] A 0 0 {
			prtln(0);
			return;
		} prtln(0) prtln 0 return; long answer = 1L; answer 1L for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		} {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		} if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			} A[i] <= (long)(1e18) / answer A[i] A i (long)(1e18) / answer (long)(1e18) answer {
				answer *= A[i];
			} answer *= A[i] answer A[i] A i {
				prtln(-1);
				return;
			} prtln(-1) prtln -1 1 return; prtln(answer) prtln answer String[] args args public static <T> void prtln(T t) { System.out.println(t); } prtln { System.out.println(t); } System.out.println(t) System.out.println System.out System System.out t T t t public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		}
		sc.close();
		Arrays.sort(A);
		// 0があるなら答えは必ず0
		if(A[0] == 0) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		}
		sc.close();
		Arrays.sort(A);
		// 0があるなら答えは必ず0
		if(A[0] == 0) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} 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];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
		}
		sc.close();
		Arrays.sort(A);
		// 0があるなら答えは必ず0
		if(A[0] == 0) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			if(A[i] <= (long)(1e18) / answer) {
				answer *= A[i];
			} else {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
}