import java.util.Scanner;
public class Main {
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long a[]=new long[n];
		long ans=1;
		long x=(long)(Math.pow(10, 18));
		for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		}
		if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		}
				System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long a[]=new long[n];
		long ans=1;
		long x=(long)(Math.pow(10, 18));
		for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		}
		if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		}
				System.out.println(ans);
	}
} Main public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long a[]=new long[n];
		long ans=1;
		long x=(long)(Math.pow(10, 18));
		for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		}
		if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		}
				System.out.println(ans);
	} main {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long a[]=new long[n];
		long ans=1;
		long x=(long)(Math.pow(10, 18));
		for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		}
		if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		}
				System.out.println(ans);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc long a[]=new long[n]; a new long[n] n long ans=1; ans 1 long x=(long)(Math.pow(10, 18)); x (long)(Math.pow(10, 18)) Math.pow Math 10 18 for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		} {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		} a[i]=sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i]==0) {
				ans=0;
			} a[i]==0 a[i] a i 0 {
				ans=0;
			} ans=0 ans 0 if(a[i]>x) {
				ans=-1;
			} a[i]>x a[i] a i x {
				ans=-1;
			} ans=-1 ans -1 1 if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		} ans!=0&&ans!=-1 ans!=0 ans 0 ans!=-1 ans -1 1 {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		} for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			} {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			} if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					} Math.log10(ans)+Math.log10(a[i])<18.5 Math.log10(ans)+Math.log10(a[i]) Math.log10(ans) Math.log10 Math ans Math.log10(a[i]) Math.log10 Math a[i] a i 18.5 {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					} ans*=a[i] ans a[i] a i if(ans>x) {
						ans=-1;
						break;
					} ans>x ans x {
						ans=-1;
						break;
					} ans=-1 ans -1 1 break; {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					} if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						} Math.log(ans)+Math.log10(a[i])>18 Math.log(ans)+Math.log10(a[i]) Math.log(ans) Math.log Math ans Math.log10(a[i]) Math.log10 Math a[i] a i 18 {
							ans=-1;
							break;
						} ans=-1 ans -1 1 break; 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[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long a[]=new long[n];
		long ans=1;
		long x=(long)(Math.pow(10, 18));
		for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		}
		if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		}
				System.out.println(ans);
	}
} public class Main {
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long a[]=new long[n];
		long ans=1;
		long x=(long)(Math.pow(10, 18));
		for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		}
		if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		}
				System.out.println(ans);
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String args[]) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long a[]=new long[n];
		long ans=1;
		long x=(long)(Math.pow(10, 18));
		for(int i=0;i<n;i++) {
			a[i]=sc.nextLong();
			if(a[i]==0) {
				ans=0;
			}
			if(a[i]>x) {
				ans=-1;
			}
		}
		if(ans!=0&&ans!=-1) {
				for(int i=0;i<n;i++) {
					if(Math.log10(ans)+Math.log10(a[i])<18.5) {
					ans*=a[i];
					if(ans>x) {
						ans=-1;
						break;
					}
					}
					else {
						if(Math.log(ans)+Math.log10(a[i])>18) {
							ans=-1;
							break;
						}
					}
			}
		}
				System.out.println(ans);
	}
}
