import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	}

} Main public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	} main {
		try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	} try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		} {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) long max = (long)Math.pow(10, 18); max (long)Math.pow(10, 18) Math.pow Math 10 18 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long ans = 1; ans 1 boolean isOver = false; isOver false for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			} {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			} long ai = sc.nextLong(); ai sc.nextLong() sc.nextLong sc if ( ai == 0 ) {
					System.out.println("0");
					return;
				} ai == 0 ai 0 {
					System.out.println("0");
					return;
				} System.out.println("0") System.out.println System.out System System.out "0" return; if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				} !isOver isOver {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				} try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					} catch(Exception e) {
						isOver = true;
					} Exception e {
						isOver = true;
					} isOver = true isOver true {
						ans = Math.multiplyExact(ans, ai);
					} ans = Math.multiplyExact(ans, ai) ans Math.multiplyExact(ans, ai) Math.multiplyExact Math ans ai if ( ans > max || ans < 0 ) {
					isOver = true;
				} ans > max || ans < 0 ans > max ans max ans < 0 ans 0 {
					isOver = true;
				} isOver = true isOver true if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			} isOver {
				System.out.println("-1");
			} System.out.println("-1") System.out.println System.out System System.out "-1" {
				System.out.println(ans);
			} 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){
		try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	}

} public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {

			//			long a = Long.MAX_VALUE + 1;
			long max = (long)Math.pow(10, 18);

			//			System.out.println(a);
			//			System.out.println(max+1);


			int n = sc.nextInt();

			long ans = 1;
			boolean isOver = false;
			for(int i = 0 ; i < n ; i++ ) {
				long ai = sc.nextLong();

				if ( ai == 0 ) {
					System.out.println("0");
					return;
				}

				if ( !isOver ) {
					try {
						ans = Math.multiplyExact(ans, ai);
					}
					catch(Exception e) {
						isOver = true;
					}
				}

				if ( ans > max || ans < 0 ) {
					isOver = true;
				}
			}

			if ( isOver ) {
				System.out.println("-1");
			}
			else {
				System.out.println(ans);
			}

		}
	}

}