import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} Main public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	} main {
		try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	} try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		} {
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		} Scanner scan = new Scanner(System.in) Scanner scan = new Scanner(System.in) new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan long[]a= new long[N]; a new long[N] N long goukei = 1; goukei 1 long S = (long)1e18; S (long)1e18 for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			} {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			} a[i] = scan.nextLong() a[i] a i scan.nextLong() scan.nextLong scan if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				} a[i]==0 a[i] a i 0 {
					System.out.println(0);
					System.exit(0);
				} System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 BigDecimal ans = new BigDecimal(1); ans new BigDecimal(1) BigDecimal jou = new BigDecimal(S); jou new BigDecimal(S) for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			} int i = 0; int i = 0; i 0 i<N i N i++ i++ i {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			} {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			} ans = ans.multiply(new BigDecimal(a[i])) ans ans.multiply(new BigDecimal(a[i])) ans.multiply ans new BigDecimal(a[i]) int p = ans.compareTo(jou); p ans.compareTo(jou) ans.compareTo ans jou if(p>0) {
					System.out.println(-1);
					System.exit(0);
				} p>0 p 0 {
					System.out.println(-1);
					System.exit(0);
				} System.out.println(-1) System.out.println System.out System System.out -1 1 System.exit(0) System.exit System 0 System.out.println(ans.longValue()) System.out.println System.out System System.out ans.longValue() ans.longValue ans String[]args args public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

} Main
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[]args) {
		try(Scanner scan = new Scanner(System.in)){
			
			
			int N = scan.nextInt();
			long[]a= new long[N];
			long goukei = 1;
			long S = (long)1e18;
			
			for(int i = 0;i<N;i++) {
				a[i] = scan.nextLong();
				
				if(a[i]==0) {
					System.out.println(0);
					System.exit(0);
				}
			}
			
			BigDecimal ans = new BigDecimal(1);
			BigDecimal jou = new BigDecimal(S);
			
		
			
			for(int i = 0;i<N;i++) {
				ans = ans.multiply(new BigDecimal(a[i]));
				int p = ans.compareTo(jou);
				
				if(p>0) {
					System.out.println(-1);
					System.exit(0);
				}
				
			}
			
			
			
			System.out.println(ans.longValue());
			
			
			
			
			
			
			
			
			
			
			
			
		}
		
		
	}
		

}
