

import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		long ans = 1;
		int N = scanner.nextInt();

		for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		}

		System.out.println(ans);

		scanner.close();

	}

} import java.util.Scanner; Scanner java.util public class Main{

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		long ans = 1;
		int N = scanner.nextInt();

		for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		}

		System.out.println(ans);

		scanner.close();

	}

} Main public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		long ans = 1;
		int N = scanner.nextInt();

		for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		}

		System.out.println(ans);

		scanner.close();

	} main {

		Scanner scanner=new Scanner(System.in);
		long ans = 1;
		int N = scanner.nextInt();

		for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		}

		System.out.println(ans);

		scanner.close();

	} Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) long ans = 1; ans 1 int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		} int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		} {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		} long A = scanner.nextLong(); A scanner.nextLong() scanner.nextLong scanner if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			} A == 0 A 0 {
				ans = 0;
			} ans = 0 ans 0 {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			} if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				} ans <= ((long)Math.pow(10, 18) / A) && ans >= 0 ans <= ((long)Math.pow(10, 18) / A) ans ((long)Math.pow(10, 18) / A) (long)Math.pow(10, 18) Math.pow Math 10 18 A ans >= 0 ans 0 {
					ans = ans * A;
				} ans = ans * A ans ans * A ans A {
					ans = -1;
				} ans = -1 ans -1 1 System.out.println(ans) System.out.println System.out System System.out ans scanner.close() scanner.close scanner String[] args args public class Main{

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		long ans = 1;
		int N = scanner.nextInt();

		for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		}

		System.out.println(ans);

		scanner.close();

	}

} public class Main{

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		long ans = 1;
		int N = scanner.nextInt();

		for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		}

		System.out.println(ans);

		scanner.close();

	}

} Main


import java.util.Scanner;

public class Main{

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		long ans = 1;
		int N = scanner.nextInt();

		for(int i = 0 ; i < N ; i++) {
			long A = scanner.nextLong();
			if(A == 0) {
				ans = 0;
			} else {
				if(ans <= ((long)Math.pow(10, 18) / A) && ans >= 0) {
					ans = ans * A;
				}else {
					ans = -1;
				}
			}
		}

		System.out.println(ans);

		scanner.close();

	}

}
