import java.util.Scanner;

public class Main {
	private static final long MAX = 1000000000000000000L;
	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		int zero = -1;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		}
		sc.close();
		if(zero > -1) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} import java.util.Scanner; Scanner java.util public class Main {
	private static final long MAX = 1000000000000000000L;
	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		int zero = -1;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		}
		sc.close();
		if(zero > -1) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} Main private static final long MAX = 1000000000000000000L; MAX 1000000000000000000L public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		int zero = -1;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		}
		sc.close();
		if(zero > -1) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		int zero = -1;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		}
		sc.close();
		if(zero > -1) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	} 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 int zero = -1; zero -1 1 for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		} {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		} A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc if(A[i] == 0) zero = i; A[i] == 0 A[i] A i 0 zero = i zero i sc.close() sc.close sc if(zero > -1) {
			prtln(0);
			return;
		} zero > -1 zero -1 1 {
			prtln(0);
			return;
		} prtln(0) prtln 0 return; long answer = 1L; answer 1L for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		} {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		} try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			} ArithmeticException e {
				prtln(-1);
				return;
			} prtln(-1) prtln -1 1 return; {
				answer = Math.multiplyExact(answer, A[i]);
			} answer = Math.multiplyExact(answer, A[i]) answer Math.multiplyExact(answer, A[i]) Math.multiplyExact Math answer A[i] A i if(answer > MAX) {
				prtln(-1);
				return;
			} answer > MAX answer MAX {
				prtln(-1);
				return;
			} prtln(-1) prtln -1 1 return; prtln(answer) prtln answer final String[] args args public static <T> void prtln(T t) { System.out.println(t); } prtln { System.out.println(t); } System.out.println(t) System.out.println System.out System System.out t T t t public class Main {
	private static final long MAX = 1000000000000000000L;
	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		int zero = -1;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		}
		sc.close();
		if(zero > -1) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} public class Main {
	private static final long MAX = 1000000000000000000L;
	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		int zero = -1;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		}
		sc.close();
		if(zero > -1) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
} Main
import java.util.Scanner;

public class Main {
	private static final long MAX = 1000000000000000000L;
	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] A = new long[N];
		int zero = -1;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) zero = i;
		}
		sc.close();
		if(zero > -1) {
			prtln(0);
			return;
		}
		long answer = 1L;
		for(int i = 0; i < N; i++) {
			try {
				answer = Math.multiplyExact(answer, A[i]);
			} catch(ArithmeticException e) {
				prtln(-1);
				return;
			}
			if(answer > MAX) {
				prtln(-1);
				return;
			}
		}
		prtln(answer);
	}

	public static <T> void prtln(T t) { System.out.println(t); }
}