import java.util.Scanner;
import java.util.Arrays;
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();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		}
		
		Arrays.sort(A);
		
		long ans =1;
		
		for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		}
		System.out.println(ans);
		sc.close();
	}

} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays 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();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		}
		
		Arrays.sort(A);
		
		long ans =1;
		
		for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		}
		System.out.println(ans);
		sc.close();
	}

} 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();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		}
		
		Arrays.sort(A);
		
		long ans =1;
		
		for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		}
		System.out.println(ans);
		sc.close();
	} 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();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		}
		
		Arrays.sort(A);
		
		long ans =1;
		
		for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		}
		System.out.println(ans);
		sc.close();
	} 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();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			A[i]=sc.nextLong();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		} {
			A[i]=sc.nextLong();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		} A[i]=sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc if(A[i]==0) {
				System.out.println(0);
				return;
			} A[i]==0 A[i] A i 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; Arrays.sort(A) Arrays.sort Arrays A long ans =1; ans 1 for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		} int i=N-1; int i=N-1; i N-1 N 1 i>=0 i 0 i-- i-- i {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		} {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		} if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			} A[i]> 1000000000000000000L/ans A[i] A i 1000000000000000000L/ans 1000000000000000000L ans {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
				ans *= A[i];
			} ans *= A[i] ans A[i] A i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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];
		
		for(int i=0;i<N;i++) {
			A[i]=sc.nextLong();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		}
		
		Arrays.sort(A);
		
		long ans =1;
		
		for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		}
		System.out.println(ans);
		sc.close();
	}

} 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();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		}
		
		Arrays.sort(A);
		
		long ans =1;
		
		for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		}
		System.out.println(ans);
		sc.close();
	}

} Main
import java.util.Scanner;
import java.util.Arrays;
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();
			if(A[i]==0) {
				System.out.println(0);
				return;
			}
		}
		
		Arrays.sort(A);
		
		long ans =1;
		
		for(int i=N-1;i>=0;i--) {
			if(A[i]> 1000000000000000000L/ans) {
				System.out.println(-1);
				return;
			}else {
				ans *= A[i];
			}
		}
		System.out.println(ans);
		sc.close();
	}

}