import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long total = 1;
		
		for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		}
		System.out.print(total);
		
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long total = 1;
		
		for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		}
		System.out.print(total);
		
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long total = 1;
		
		for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		}
		System.out.print(total);
		
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long total = 1;
		
		for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		}
		System.out.print(total);
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) long a = scan.nextLong(); a scan.nextLong() scan.nextLong scan long total = 1; total 1 for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		} int i=0; int i=0; i 0 i<a i a i++ i++ i {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		} {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		} long n = scan.nextLong(); n scan.nextLong() scan.nextLong scan if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			} n == 0 n 0 {
				total = 0;
			} total = 0 total 0 {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			} if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				} total <= ((long)Math.pow(10,18)/n) total ((long)Math.pow(10,18)/n) (long)Math.pow(10,18) Math.pow Math 10 18 n {
					if(total >= 0) {
						total *= n;
					}
				} if(total >= 0) {
						total *= n;
					} total >= 0 total 0 {
						total *= n;
					} total *= n total n {
					total = -1;
				} total = -1 total -1 1 System.out.print(total) System.out.print System.out System System.out total String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long total = 1;
		
		for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		}
		System.out.print(total);
		
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long total = 1;
		
		for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		}
		System.out.print(total);
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long total = 1;
		
		for(int i=0;i<a;i++) {
			long n = scan.nextLong();
			if(n == 0) {
				total = 0;
			}
			else {
				if(total <= ((long)Math.pow(10,18)/n)) {
					if(total >= 0) {
						total *= n;
					}
				}else {
					total = -1;
				}
			}
		}
		System.out.print(total);
		
	}

}