import java.util.*;
import java.math.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		final BigInteger TEN_EIGHTEEN = new BigInteger("1000000000000000000");
		final BigInteger ZERO = new BigInteger("0");
		final BigInteger OVER = new BigInteger("-1");
		String[] s = new String[N];
		Boolean flag_z = false;
		for (int i = 0; i < N; ++i) {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		}
		if (flag_z) {
			ans = ZERO;
		} else {
			for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			}
		}
		// System.out.println(" "+ans.toString());
		sc.close();
		if (ans.compareTo(ZERO) == -1) {
			System.out.println("-1");
		}else{
			System.out.println(ans.toString());
		}
	}
} import java.util.*; util.* java import java.math.*; math.* java class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		final BigInteger TEN_EIGHTEEN = new BigInteger("1000000000000000000");
		final BigInteger ZERO = new BigInteger("0");
		final BigInteger OVER = new BigInteger("-1");
		String[] s = new String[N];
		Boolean flag_z = false;
		for (int i = 0; i < N; ++i) {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		}
		if (flag_z) {
			ans = ZERO;
		} else {
			for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			}
		}
		// System.out.println(" "+ans.toString());
		sc.close();
		if (ans.compareTo(ZERO) == -1) {
			System.out.println("-1");
		}else{
			System.out.println(ans.toString());
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		final BigInteger TEN_EIGHTEEN = new BigInteger("1000000000000000000");
		final BigInteger ZERO = new BigInteger("0");
		final BigInteger OVER = new BigInteger("-1");
		String[] s = new String[N];
		Boolean flag_z = false;
		for (int i = 0; i < N; ++i) {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		}
		if (flag_z) {
			ans = ZERO;
		} else {
			for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			}
		}
		// System.out.println(" "+ans.toString());
		sc.close();
		if (ans.compareTo(ZERO) == -1) {
			System.out.println("-1");
		}else{
			System.out.println(ans.toString());
		}
	} main {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		final BigInteger TEN_EIGHTEEN = new BigInteger("1000000000000000000");
		final BigInteger ZERO = new BigInteger("0");
		final BigInteger OVER = new BigInteger("-1");
		String[] s = new String[N];
		Boolean flag_z = false;
		for (int i = 0; i < N; ++i) {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		}
		if (flag_z) {
			ans = ZERO;
		} else {
			for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			}
		}
		// System.out.println(" "+ans.toString());
		sc.close();
		if (ans.compareTo(ZERO) == -1) {
			System.out.println("-1");
		}else{
			System.out.println(ans.toString());
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc BigInteger ans = new BigInteger("1"); ans new BigInteger("1") final BigInteger TEN_EIGHTEEN = new BigInteger("1000000000000000000"); TEN_EIGHTEEN new BigInteger("1000000000000000000") final BigInteger ZERO = new BigInteger("0"); ZERO new BigInteger("0") final BigInteger OVER = new BigInteger("-1"); OVER new BigInteger("-1") String[] s = new String[N]; s new String[N] N Boolean flag_z = false; flag_z false for (int i = 0; i < N; ++i) {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		} int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		} {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		} s[i] = sc.next() s[i] s i sc.next() sc.next sc if (s[i].equals("0")) {
				flag_z = true;
			} s[i].equals("0") s[i].equals s[i] s i "0" {
				flag_z = true;
			} flag_z = true flag_z true if (flag_z) {
			ans = ZERO;
		} else {
			for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			}
		} flag_z {
			ans = ZERO;
		} ans = ZERO ans ZERO {
			for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			}
		} for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			} int i = 0; int i = 0; i 0 i < N i N ++i ++i i {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			} {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			} BigInteger A = new BigInteger(s[i]); A new BigInteger(s[i]) if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				} A.compareTo(ZERO) != 0 A.compareTo(ZERO) A.compareTo A ZERO 0 {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					} ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0 ans.multiply(A).compareTo(TEN_EIGHTEEN) ans.multiply(A).compareTo ans.multiply(A) ans.multiply ans A TEN_EIGHTEEN 0 {
						ans = ans.multiply(A);
					} ans = ans.multiply(A) ans ans.multiply(A) ans.multiply ans A {
						ans = OVER;
						break;
					} ans = OVER ans OVER break; {
					ans = ZERO;
					break;
				} ans = ZERO ans ZERO break; sc.close() sc.close sc if (ans.compareTo(ZERO) == -1) {
			System.out.println("-1");
		}else{
			System.out.println(ans.toString());
		} ans.compareTo(ZERO) == -1 ans.compareTo(ZERO) ans.compareTo ans ZERO -1 1 {
			System.out.println("-1");
		} System.out.println("-1") System.out.println System.out System System.out "-1" {
			System.out.println(ans.toString());
		} System.out.println(ans.toString()) System.out.println System.out System System.out ans.toString() ans.toString ans String[] args args
import java.util.*;
import java.math.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		BigInteger ans = new BigInteger("1");
		final BigInteger TEN_EIGHTEEN = new BigInteger("1000000000000000000");
		final BigInteger ZERO = new BigInteger("0");
		final BigInteger OVER = new BigInteger("-1");
		String[] s = new String[N];
		Boolean flag_z = false;
		for (int i = 0; i < N; ++i) {
			s[i] = sc.next();
			if (s[i].equals("0")) {
				flag_z = true;
			}
		}
		if (flag_z) {
			ans = ZERO;
		} else {
			for (int i = 0; i < N; ++i) {
				BigInteger A = new BigInteger(s[i]);
				if (A.compareTo(ZERO) != 0) {
					if (ans.multiply(A).compareTo(TEN_EIGHTEEN) <= 0) {
						ans = ans.multiply(A);
					} else {
						ans = OVER;
						break;
					}
				} else {
					ans = ZERO;
					break;
				}
			}
		}
		// System.out.println(" "+ans.toString());
		sc.close();
		if (ans.compareTo(ZERO) == -1) {
			System.out.println("-1");
		}else{
			System.out.println(ans.toString());
		}
	}
}
