import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	static long mod = 1000000007;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String[] t = sc.nextLine().split(" ");
		int  n = Integer.parseInt(t[0]);
		//long k = Long.parseLong(t[1]);

		String[] r = sc.nextLine().split(" ");
		BigInteger ans = BigInteger.ONE;
		BigInteger max = BigInteger.ONE;
		for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		}

		for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		}

		if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		}
		System.out.println(ans);
	}
} import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {

	static long mod = 1000000007;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String[] t = sc.nextLine().split(" ");
		int  n = Integer.parseInt(t[0]);
		//long k = Long.parseLong(t[1]);

		String[] r = sc.nextLine().split(" ");
		BigInteger ans = BigInteger.ONE;
		BigInteger max = BigInteger.ONE;
		for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		}

		for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		}

		if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		}
		System.out.println(ans);
	}
} Main static long mod = 1000000007; mod 1000000007 public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String[] t = sc.nextLine().split(" ");
		int  n = Integer.parseInt(t[0]);
		//long k = Long.parseLong(t[1]);

		String[] r = sc.nextLine().split(" ");
		BigInteger ans = BigInteger.ONE;
		BigInteger max = BigInteger.ONE;
		for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		}

		for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		}

		if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		}
		System.out.println(ans);
	} main {

		Scanner sc = new Scanner(System.in);
		String[] t = sc.nextLine().split(" ");
		int  n = Integer.parseInt(t[0]);
		//long k = Long.parseLong(t[1]);

		String[] r = sc.nextLine().split(" ");
		BigInteger ans = BigInteger.ONE;
		BigInteger max = BigInteger.ONE;
		for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		}

		for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		}

		if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] t = sc.nextLine().split(" "); t sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int  n = Integer.parseInt(t[0]); n Integer.parseInt(t[0]) Integer.parseInt Integer t[0] t 0 String[] r = sc.nextLine().split(" "); r sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " BigInteger ans = BigInteger.ONE; ans BigInteger.ONE BigInteger BigInteger.ONE BigInteger max = BigInteger.ONE; max BigInteger.ONE BigInteger BigInteger.ONE for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		} int i = 0; int i = 0; i 0 i < 18 i 18 i++ i++ i {
			max = max.multiply(BigInteger.valueOf(10));
		} {
			max = max.multiply(BigInteger.valueOf(10));
		} max = max.multiply(BigInteger.valueOf(10)) max max.multiply(BigInteger.valueOf(10)) max.multiply max BigInteger.valueOf(10) BigInteger.valueOf BigInteger 10 for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		} int i = 0; int i = 0; i 0 i < n i n i ++ i ++ i {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		} {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		} if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			} BigInteger.ZERO.equals(new BigInteger(r[i])) BigInteger.ZERO.equals BigInteger.ZERO BigInteger BigInteger.ZERO new BigInteger(r[i]) {
				ans = BigInteger.ZERO;
				break;
			} ans = BigInteger.ZERO ans BigInteger.ZERO BigInteger BigInteger.ZERO break; if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		} Integer.parseInt(ans.toString()) == 0 Integer.parseInt(ans.toString()) Integer.parseInt Integer ans.toString() ans.toString ans 0 {
			System.out.println(ans);
			return;
		} System.out.println(ans) System.out.println System.out System System.out ans return; for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		} int i = 0; int i = 0; i 0 i < n i n i ++ i ++ i {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		} {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		} ans = ans.multiply(new BigInteger(r[i])) ans ans.multiply(new BigInteger(r[i])) ans.multiply ans new BigInteger(r[i]) if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			} ans.compareTo(max) > 0 ans.compareTo(max) ans.compareTo ans max 0 {

			ans = BigInteger.valueOf(-1);
			break;
			} ans = BigInteger.valueOf(-1) ans BigInteger.valueOf(-1) BigInteger.valueOf BigInteger -1 1 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	static long mod = 1000000007;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String[] t = sc.nextLine().split(" ");
		int  n = Integer.parseInt(t[0]);
		//long k = Long.parseLong(t[1]);

		String[] r = sc.nextLine().split(" ");
		BigInteger ans = BigInteger.ONE;
		BigInteger max = BigInteger.ONE;
		for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		}

		for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		}

		if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		}
		System.out.println(ans);
	}
} public class Main {

	static long mod = 1000000007;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String[] t = sc.nextLine().split(" ");
		int  n = Integer.parseInt(t[0]);
		//long k = Long.parseLong(t[1]);

		String[] r = sc.nextLine().split(" ");
		BigInteger ans = BigInteger.ONE;
		BigInteger max = BigInteger.ONE;
		for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		}

		for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		}

		if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		}
		System.out.println(ans);
	}
} Main
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	static long mod = 1000000007;

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String[] t = sc.nextLine().split(" ");
		int  n = Integer.parseInt(t[0]);
		//long k = Long.parseLong(t[1]);

		String[] r = sc.nextLine().split(" ");
		BigInteger ans = BigInteger.ONE;
		BigInteger max = BigInteger.ONE;
		for (int i = 0; i < 18; i++) {
			max = max.multiply(BigInteger.valueOf(10));
		}

		for(int i = 0; i < n; i ++) {

			if (BigInteger.ZERO.equals(new BigInteger(r[i]))) {
				ans = BigInteger.ZERO;
				break;
			}
		}

		if(Integer.parseInt(ans.toString()) == 0) {
			System.out.println(ans);
			return;
		}

		for(int i = 0; i < n; i ++) {
			ans = ans.multiply(new BigInteger(r[i]));
			if(ans.compareTo(max) > 0) {

			ans = BigInteger.valueOf(-1);
			break;
			}
		}
		System.out.println(ans);
	}
}
