import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		long ans = 1;
		for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		}
		System.out.print(ans);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		long ans = 1;
		for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		}
		System.out.print(ans);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		long ans = 1;
		for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		}
		System.out.print(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		long ans = 1;
		for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		}
		System.out.print(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = Integer.parseInt(scan.next()); n Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan long ans = 1; ans 1 for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		} int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		} {
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		} long a = Long.parseLong(scan.next()); a Long.parseLong(scan.next()) Long.parseLong Long scan.next() scan.next scan if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			} Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L Math.log10(a) + Math.log10(ans) > 18 Math.log10(a) + Math.log10(ans) Math.log10(a) Math.log10 Math a Math.log10(ans) Math.log10 Math ans 18 ans*a > 1000000000000000000L ans*a ans a 1000000000000000000L {
				ans = -1;
			} ans = -1 ans -1 1 if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			} a == 0 a 0 {
				ans = 0;
			} ans = 0 ans 0 if(ans != -1){
				ans *= a;
			} ans != -1 ans -1 1 {
				ans *= a;
			} ans *= a ans a System.out.print(ans) System.out.print System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		long ans = 1;
		for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		}
		System.out.print(ans);
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		long ans = 1;
		for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		}
		System.out.print(ans);
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		long ans = 1;
		for(int i = 0;i < n; ++i){
			long a = Long.parseLong(scan.next());
			if(Math.log10(a) + Math.log10(ans) > 18 || ans*a > 1000000000000000000L){
				ans = -1;
			}else if(a == 0){
				ans = 0;
			}else if(ans != -1){
				ans *= a;
			}
		}
		System.out.print(ans);
	}
}