import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;

public class Main {
	static int N;
	static long[] A;
	static long MAX = (long) 1e18;
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		read();
	}

	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		N = Integer.parseInt(br.readLine());
		String[] word = br.readLine().split("\\s+");
		A = new long[N];
		for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		}
		Arrays.sort(A);
		BigInteger res = BigInteger.ONE;
		for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		}
		System.out.println(res);
		br.close();
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.math.BigInteger; BigInteger java.math import java.util.Arrays; Arrays java.util public class Main {
	static int N;
	static long[] A;
	static long MAX = (long) 1e18;
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		read();
	}

	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		N = Integer.parseInt(br.readLine());
		String[] word = br.readLine().split("\\s+");
		A = new long[N];
		for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		}
		Arrays.sort(A);
		BigInteger res = BigInteger.ONE;
		for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		}
		System.out.println(res);
		br.close();
	}

} Main static int N; N static long[] A; A static long MAX = (long) 1e18; MAX (long) 1e18 public static void main(String[] args) throws NumberFormatException, IOException {
		read();
	} main {
		read();
	} read() read String[] args args private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		N = Integer.parseInt(br.readLine());
		String[] word = br.readLine().split("\\s+");
		A = new long[N];
		for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		}
		Arrays.sort(A);
		BigInteger res = BigInteger.ONE;
		for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		}
		System.out.println(res);
		br.close();
	} read {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		N = Integer.parseInt(br.readLine());
		String[] word = br.readLine().split("\\s+");
		A = new long[N];
		for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		}
		Arrays.sort(A);
		BigInteger res = BigInteger.ONE;
		for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		}
		System.out.println(res);
		br.close();
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) N = Integer.parseInt(br.readLine()) N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] word = br.readLine().split("\\s+"); word br.readLine().split("\\s+") br.readLine().split br.readLine() br.readLine br "\\s+" A = new long[N] A new long[N] N for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = Long.valueOf(word[i]);
		} {
			A[i] = Long.valueOf(word[i]);
		} A[i] = Long.valueOf(word[i]) A[i] A i Long.valueOf(word[i]) Long.valueOf Long word[i] word i Arrays.sort(A) Arrays.sort Arrays A BigInteger res = BigInteger.ONE; res BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		} {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		} res = res.multiply(BigInteger.valueOf(A[i])) res res.multiply(BigInteger.valueOf(A[i])) res.multiply res BigInteger.valueOf(A[i]) BigInteger.valueOf BigInteger A[i] A i if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			} res.compareTo(BigInteger.valueOf(MAX) ) > 0 res.compareTo(BigInteger.valueOf(MAX) ) res.compareTo res BigInteger.valueOf(MAX) BigInteger.valueOf BigInteger MAX 0 {
				System.out.println(-1);
				br.close();
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 br.close() br.close br return; System.out.println(res) System.out.println System.out System System.out res br.close() br.close br public class Main {
	static int N;
	static long[] A;
	static long MAX = (long) 1e18;
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		read();
	}

	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		N = Integer.parseInt(br.readLine());
		String[] word = br.readLine().split("\\s+");
		A = new long[N];
		for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		}
		Arrays.sort(A);
		BigInteger res = BigInteger.ONE;
		for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		}
		System.out.println(res);
		br.close();
	}

} public class Main {
	static int N;
	static long[] A;
	static long MAX = (long) 1e18;
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		read();
	}

	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		N = Integer.parseInt(br.readLine());
		String[] word = br.readLine().split("\\s+");
		A = new long[N];
		for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		}
		Arrays.sort(A);
		BigInteger res = BigInteger.ONE;
		for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		}
		System.out.println(res);
		br.close();
	}

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.Arrays;

public class Main {
	static int N;
	static long[] A;
	static long MAX = (long) 1e18;
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		read();
	}

	private static void read() throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		N = Integer.parseInt(br.readLine());
		String[] word = br.readLine().split("\\s+");
		A = new long[N];
		for (int i = 0; i < N; i++) {
			A[i] = Long.valueOf(word[i]);
		}
		Arrays.sort(A);
		BigInteger res = BigInteger.ONE;
		for (int i = 0; i < N; i++) {
			res = res.multiply(BigInteger.valueOf(A[i]));
			if ( res.compareTo(BigInteger.valueOf(MAX) ) > 0 ){
				System.out.println(-1);
				br.close();
				return;
			}

		}
		System.out.println(res);
		br.close();
	}

}
