import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] arr = new long[n];
		long h = (long)Math.pow(10,18);
		//System.out.println(h);
		//int flag =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		}
		//if(flag==0){
		Arrays.sort(arr);
		long ans =1;
		for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		}
		System.out.println(ans>(long)1e18 ? -1:ans);
		//}
		// else{
		// 	System.out.println(0);
		// }
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] arr = new long[n];
		long h = (long)Math.pow(10,18);
		//System.out.println(h);
		//int flag =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		}
		//if(flag==0){
		Arrays.sort(arr);
		long ans =1;
		for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		}
		System.out.println(ans>(long)1e18 ? -1:ans);
		//}
		// else{
		// 	System.out.println(0);
		// }
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] arr = new long[n];
		long h = (long)Math.pow(10,18);
		//System.out.println(h);
		//int flag =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		}
		//if(flag==0){
		Arrays.sort(arr);
		long ans =1;
		for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		}
		System.out.println(ans>(long)1e18 ? -1:ans);
		//}
		// else{
		// 	System.out.println(0);
		// }
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] arr = new long[n];
		long h = (long)Math.pow(10,18);
		//System.out.println(h);
		//int flag =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		}
		//if(flag==0){
		Arrays.sort(arr);
		long ans =1;
		for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		}
		System.out.println(ans>(long)1e18 ? -1:ans);
		//}
		// else{
		// 	System.out.println(0);
		// }
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long[] arr = new long[n]; arr new long[n] n long h = (long)Math.pow(10,18); h (long)Math.pow(10,18) Math.pow Math 10 18 for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		} {
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		} arr[i]=sc.nextLong() arr[i] arr i sc.nextLong() sc.nextLong sc Arrays.sort(arr) Arrays.sort Arrays arr long ans =1; ans 1 for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		} {
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		} if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			} ans*1.0*arr[i]>1e18 ans*1.0*arr[i] ans*1.0*arr[i] ans 1.0 arr[i] arr i 1e18 {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans=ans*arr[i] ans ans*arr[i] ans arr[i] arr i System.out.println(ans>(long)1e18 ? -1:ans) System.out.println System.out System System.out ans>(long)1e18 ? -1:ans ans>(long)1e18 ans (long)1e18 -1 1 ans String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] arr = new long[n];
		long h = (long)Math.pow(10,18);
		//System.out.println(h);
		//int flag =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		}
		//if(flag==0){
		Arrays.sort(arr);
		long ans =1;
		for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		}
		System.out.println(ans>(long)1e18 ? -1:ans);
		//}
		// else{
		// 	System.out.println(0);
		// }
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] arr = new long[n];
		long h = (long)Math.pow(10,18);
		//System.out.println(h);
		//int flag =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		}
		//if(flag==0){
		Arrays.sort(arr);
		long ans =1;
		for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		}
		System.out.println(ans>(long)1e18 ? -1:ans);
		//}
		// else{
		// 	System.out.println(0);
		// }
	}
} Main
import java.util.*;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] arr = new long[n];
		long h = (long)Math.pow(10,18);
		//System.out.println(h);
		//int flag =0;
		for(int i=0;i<n;i++){
			arr[i]=sc.nextLong();
			// if(arr[i]==0){
			// 	flag = 1;
			// }
		}
		//if(flag==0){
		Arrays.sort(arr);
		long ans =1;
		for(int i=0;i<n;i++){
			//ans=ans*arr[i];
			if(ans*1.0*arr[i]>1e18){
				System.out.println(-1);
				return;
			}
			ans=ans*arr[i];
		}
		System.out.println(ans>(long)1e18 ? -1:ans);
		//}
		// else{
		// 	System.out.println(0);
		// }
	}
}