import java.util.Arrays;
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 judge = (long) Math.pow(10, 18);
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		Arrays.sort(a);
		if(a[0]==0) {
			System.out.println(0);
			return;
		}
		long ans = 1;
		for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		}
		System.out.println(ans);
	}
} import java.util.Arrays; Arrays java.util 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 judge = (long) Math.pow(10, 18);
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		Arrays.sort(a);
		if(a[0]==0) {
			System.out.println(0);
			return;
		}
		long ans = 1;
		for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		}
		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 judge = (long) Math.pow(10, 18);
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		Arrays.sort(a);
		if(a[0]==0) {
			System.out.println(0);
			return;
		}
		long ans = 1;
		for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		long judge = (long) Math.pow(10, 18);
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		Arrays.sort(a);
		if(a[0]==0) {
			System.out.println(0);
			return;
		}
		long ans = 1;
		for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		}
		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 judge = (long) Math.pow(10, 18); judge (long) Math.pow(10, 18) Math.pow Math 10 18 for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = sc.nextLong();
		} {
			a[i] = sc.nextLong();
		} a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc Arrays.sort(a) Arrays.sort Arrays a if(a[0]==0) {
			System.out.println(0);
			return;
		} a[0]==0 a[0] a 0 0 {
			System.out.println(0);
			return;
		} System.out.println(0) System.out.println System.out System System.out 0 return; long ans = 1; ans 1 for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		} {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		} if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			} ans>judge/a[i] ans judge/a[i] judge a[i] a i {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans*=a[i] ans a[i] a i 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 judge = (long) Math.pow(10, 18);
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		Arrays.sort(a);
		if(a[0]==0) {
			System.out.println(0);
			return;
		}
		long ans = 1;
		for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		}
		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 judge = (long) Math.pow(10, 18);
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		Arrays.sort(a);
		if(a[0]==0) {
			System.out.println(0);
			return;
		}
		long ans = 1;
		for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		}
		System.out.println(ans);
	}
} Main
import java.util.Arrays;
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 judge = (long) Math.pow(10, 18);
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		Arrays.sort(a);
		if(a[0]==0) {
			System.out.println(0);
			return;
		}
		long ans = 1;
		for(int i = 0; i < n; i++) {
			if(ans>judge/a[i]) {
				System.out.println(-1);
				return;
			}
			ans*=a[i];
		}
		System.out.println(ans);
	}
}