import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int f_overflow = 0;
		int f_zero = 0;
		long[] A = new long[N];
		long X = 1;

		for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		}

		for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		}

		if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		}

		if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1");
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int f_overflow = 0;
		int f_zero = 0;
		long[] A = new long[N];
		long X = 1;

		for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		}

		for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		}

		if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		}

		if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1");
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int f_overflow = 0;
		int f_zero = 0;
		long[] A = new long[N];
		long X = 1;

		for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		}

		for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		}

		if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		}

		if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1");
	} main {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int f_overflow = 0;
		int f_zero = 0;
		long[] A = new long[N];
		long X = 1;

		for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		}

		for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		}

		if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		}

		if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1");
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int f_overflow = 0; f_overflow 0 int f_zero = 0; f_zero 0 long[] A = new long[N]; A new long[N] N long X = 1; X 1 for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			A[i] = scan.nextLong();
		} {
			A[i] = scan.nextLong();
		} A[i] = scan.nextLong() A[i] A i scan.nextLong() scan.nextLong scan for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		} {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		} if(A[i] == 0) {
				X = 0; f_zero = 1;
			} A[i] == 0 A[i] A i 0 {
				X = 0; f_zero = 1;
			} X = 0 X 0 f_zero = 1 f_zero 1 if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		} f_zero == 0 f_zero 0 {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		} for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			} {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			} if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				} X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18) X * A[i] / A[i] == X X * A[i] / A[i] X * A[i] X A[i] A i A[i] A i X X <= (long) Math.pow(10, 18) X (long) Math.pow(10, 18) Math.pow Math 10 18 {
					X = X * A[i];
				} X = X * A[i] X X * A[i] X A[i] A i {
					f_overflow++;
					break;
				} f_overflow++ f_overflow break; if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1"); f_overflow == 0 && X <= (long) Math.pow(10, 18) f_overflow == 0 f_overflow 0 X <= (long) Math.pow(10, 18) X (long) Math.pow(10, 18) Math.pow Math 10 18 System.out.println(X) System.out.println System.out System System.out X System.out.println("-1") System.out.println System.out System System.out "-1" String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int f_overflow = 0;
		int f_zero = 0;
		long[] A = new long[N];
		long X = 1;

		for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		}

		for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		}

		if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		}

		if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1");
	}
} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int f_overflow = 0;
		int f_zero = 0;
		long[] A = new long[N];
		long X = 1;

		for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		}

		for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		}

		if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		}

		if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1");
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		int f_overflow = 0;
		int f_zero = 0;
		long[] A = new long[N];
		long X = 1;

		for(int i = 0; i < N; i++) {
			A[i] = scan.nextLong();
		}

		for(int i = 0; i < N; i++) {
			if(A[i] == 0) {
				X = 0; f_zero = 1;
			}
		}

		if(f_zero == 0) {
			for (int i = 0; i < N; i++) {
				if(X * A[i] / A[i] == X && X <= (long) Math.pow(10, 18)) {
					X = X * A[i];
				} else {
					f_overflow++;
					break;
				}
			}
		}

		if(f_overflow == 0 && X <= (long) Math.pow(10, 18)) System.out.println(X);
		else System.out.println("-1");
	}
}
