import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int N = Integer.parseInt(in.readLine());

		String[] tokens = in.readLine().split(" ");
		long[] A = new long[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		Arrays.sort(A);
		BigDecimal result = new BigDecimal(A[0]);
		BigDecimal threshold = new BigDecimal(1000000000000000000L);
		for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		}
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.math.BigDecimal; BigDecimal java.math import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int N = Integer.parseInt(in.readLine());

		String[] tokens = in.readLine().split(" ");
		long[] A = new long[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		Arrays.sort(A);
		BigDecimal result = new BigDecimal(A[0]);
		BigDecimal threshold = new BigDecimal(1000000000000000000L);
		for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		}
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} Main public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} main {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	} InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) Main ins = new Main(in); ins new Main(in) ins.calc() ins.calc ins ins.showResult() ins.showResult ins String[] args args Main(BufferedReader in) throws IOException {
		int N = Integer.parseInt(in.readLine());

		String[] tokens = in.readLine().split(" ");
		long[] A = new long[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		Arrays.sort(A);
		BigDecimal result = new BigDecimal(A[0]);
		BigDecimal threshold = new BigDecimal(1000000000000000000L);
		for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		}
		System.out.println(result);

	} Main {
		int N = Integer.parseInt(in.readLine());

		String[] tokens = in.readLine().split(" ");
		long[] A = new long[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		Arrays.sort(A);
		BigDecimal result = new BigDecimal(A[0]);
		BigDecimal threshold = new BigDecimal(1000000000000000000L);
		for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		}
		System.out.println(result);

	} int N = Integer.parseInt(in.readLine()); N Integer.parseInt(in.readLine()) Integer.parseInt Integer in.readLine() in.readLine in String[] tokens = in.readLine().split(" "); tokens in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " long[] A = new long[N]; A new long[N] N for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		} int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
			A[i] = Long.parseLong(tokens[i]);
		} {
			A[i] = Long.parseLong(tokens[i]);
		} A[i] = Long.parseLong(tokens[i]) A[i] A i Long.parseLong(tokens[i]) Long.parseLong Long tokens[i] tokens i Arrays.sort(A) Arrays.sort Arrays A BigDecimal result = new BigDecimal(A[0]); result new BigDecimal(A[0]) BigDecimal threshold = new BigDecimal(1000000000000000000L); threshold new BigDecimal(1000000000000000000L) for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		} int i = 1; int i = 1; i 1 i < N i N ++i ++i i {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		} {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		} result = result.multiply(new BigDecimal(A[i])) result result.multiply(new BigDecimal(A[i])) result.multiply result new BigDecimal(A[i]) if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			} result.compareTo(threshold) > 0 result.compareTo(threshold) result.compareTo result threshold 0 {
				System.out.println("-1");
				return;
			} System.out.println("-1") System.out.println System.out System System.out "-1" return; System.out.println(result) System.out.println System.out System System.out result BufferedReader in in void calc() {
	} calc {
	} void showResult() {
	} showResult {
	} public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int N = Integer.parseInt(in.readLine());

		String[] tokens = in.readLine().split(" ");
		long[] A = new long[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		Arrays.sort(A);
		BigDecimal result = new BigDecimal(A[0]);
		BigDecimal threshold = new BigDecimal(1000000000000000000L);
		for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		}
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int N = Integer.parseInt(in.readLine());

		String[] tokens = in.readLine().split(" ");
		long[] A = new long[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		Arrays.sort(A);
		BigDecimal result = new BigDecimal(A[0]);
		BigDecimal threshold = new BigDecimal(1000000000000000000L);
		for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		}
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
} Main
import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		int N = Integer.parseInt(in.readLine());

		String[] tokens = in.readLine().split(" ");
		long[] A = new long[N];
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		Arrays.sort(A);
		BigDecimal result = new BigDecimal(A[0]);
		BigDecimal threshold = new BigDecimal(1000000000000000000L);
		for (int i = 1; i < N; ++i) {
			result = result.multiply(new BigDecimal(A[i]));
			if (result.compareTo(threshold) > 0) {
				System.out.println("-1");
				return;
			}
		}
		System.out.println(result);

	}

	void calc() {
	}

	void showResult() {
	}
}
