import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		Arrays.sort(a);
		
		long cons = 1000000000000000000L;
		long ans = 1 ;
		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
} import java.util.*; util.* java public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		Arrays.sort(a);
		
		long cons = 1000000000000000000L;
		long ans = 1 ;
		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		Arrays.sort(a);
		
		long cons = 1000000000000000000L;
		long ans = 1 ;
		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	} main {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		Arrays.sort(a);
		
		long cons = 1000000000000000000L;
		long ans = 1 ;
		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) int N= keyboard.nextInt(); N keyboard.nextInt() keyboard.nextInt keyboard long[] a = new long[N]; a new long[N] N for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		} int i =0; int i =0; i 0 i<N i N i++ i++ i {
			a[i] = keyboard.nextLong();			
		} {
			a[i] = keyboard.nextLong();			
		} a[i] = keyboard.nextLong() a[i] a i keyboard.nextLong() keyboard.nextLong keyboard Arrays.sort(a) Arrays.sort Arrays a long cons = 1000000000000000000L; cons 1000000000000000000L long ans = 1 ; ans 1 for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		} int j=0; int j=0; j 0 j<N j N j++ j++ j {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		} {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		} if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			} a[j] !=0 a[j] a j 0 {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			} if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				} a[j]<=cons && a[j] <= cons/ans a[j]<=cons a[j] a j cons a[j] <= cons/ans a[j] a j cons/ans cons ans {
					ans = ans*a[j];	
				} ans = ans*a[j] ans ans*a[j] ans a[j] a j {
					ans = -1;
					break;
				} ans = -1 ans -1 1 break; {
				ans = 0;
				break;
			} ans = 0 ans 0 break; System.out.print(ans) System.out.print System.out System System.out ans keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		Arrays.sort(a);
		
		long cons = 1000000000000000000L;
		long ans = 1 ;
		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		Arrays.sort(a);
		
		long cons = 1000000000000000000L;
		long ans = 1 ;
		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
} Main
import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
		
		int N= keyboard.nextInt();
		long[] a = new long[N];
		
		for(int i =0; i<N; i++) {
			a[i] = keyboard.nextLong();			
		}
		Arrays.sort(a);
		
		long cons = 1000000000000000000L;
		long ans = 1 ;
		
		for(int j=0; j<N; j++) {
			if(a[j] !=0) {
				if(a[j]<=cons && a[j] <= cons/ans) {
					ans = ans*a[j];	
				}else {
					ans = -1;
					break;
				}
			}else{
				ans = 0;
				break;
			}
		}
		
		System.out.print(ans);
		keyboard.close();	
		
	}
}
