import java.util.Scanner;


public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n]; 

		for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		long ans = nums[0];
		for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	}

} 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[] nums = new long[n]; 

		for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		long ans = nums[0];
		for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	}

} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n]; 

		for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		long ans = nums[0];
		for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	} main {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n]; 

		for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		long ans = nums[0];
		for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long[] nums = new long[n]; nums new long[n] n for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		} {
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		} nums[i] = sc.nextLong() nums[i] nums i sc.nextLong() sc.nextLong sc if(nums[i] == 0) {
				System.out.println(0);
				return;
			} nums[i] == 0 nums[i] nums i 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; long ans = nums[0]; ans nums[0] nums 0 for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		} {
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		} try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			} catch (Exception e){
				System.out.println(-1);
				return;
			} Exception e {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			} long ai = nums[i]; ai nums[i] nums i ans = Math.multiplyExact(ans,ai) ans Math.multiplyExact(ans,ai) Math.multiplyExact Math ans ai if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				} (long)Math.pow(10, 18) < ans (long)Math.pow(10, 18) Math.pow Math 10 18 ans {
					System.out.println(-1);
					return;
				} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n]; 

		for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		long ans = nums[0];
		for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	}

} public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] nums = new long[n]; 

		for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		long ans = nums[0];
		for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	}

} 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[] nums = new long[n]; 

		for(int i = 0; i < n; i++){
			nums[i] = sc.nextLong();
			if(nums[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		
		long ans = nums[0];
		for(int i = 1; i < n; i++){
			try{
				long ai = nums[i];
				ans = Math.multiplyExact(ans,ai);
				if((long)Math.pow(10, 18) < ans) {
					System.out.println(-1);
					return;
				}
			}catch (Exception e){
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(ans);
		
		sc.close();
	}

}