import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//入力表示
		int N = sc.nextInt();
		long[] a = new long[N];

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long b = a[0];
		for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(b);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//入力表示
		int N = sc.nextInt();
		long[] a = new long[N];

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long b = a[0];
		for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(b);
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//入力表示
		int N = sc.nextInt();
		long[] a = new long[N];

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long b = a[0];
		for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(b);
	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//入力表示
		int N = sc.nextInt();
		long[] a = new long[N];

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long b = a[0];
		for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(b);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long[] a = new long[N]; a new long[N] N for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		} {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		} a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if (a[i] == 0) {
				System.out.println(0);
				return;
			} a[i] == 0 a[i] a i 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; long b = a[0]; b a[0] a 0 for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			} a[i] <= 1000000000000000000L / b a[i] a i 1000000000000000000L / b 1000000000000000000L b {
				b *= a[i];
			} b *= a[i] b a[i] a i {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(b) System.out.println System.out System System.out b String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//入力表示
		int N = sc.nextInt();
		long[] a = new long[N];

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long b = a[0];
		for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(b);
	}
} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//入力表示
		int N = sc.nextInt();
		long[] a = new long[N];

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long b = a[0];
		for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(b);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc = new Scanner(System.in);

		//入力表示
		int N = sc.nextInt();
		long[] a = new long[N];

		for (int i = 0; i < N; i++) {
			a[i] = sc.nextLong();
			if (a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long b = a[0];
		for (int i = 1; i < N; i++) {
			if (a[i] <= 1000000000000000000L / b) {
				b *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(b);
	}
}