import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");

		long a[] = new long[n];

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

		long sum = 1L;
		long max = 1000000000000000000L;
		for (int i = 0; i < n; i++) {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(sum);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");

		long a[] = new long[n];

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

		long sum = 1L;
		long max = 1000000000000000000L;
		for (int i = 0; i < n; i++) {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(sum);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");

		long a[] = new long[n];

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

		long sum = 1L;
		long max = 1000000000000000000L;
		for (int i = 0; i < n; i++) {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(sum);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");

		long a[] = new long[n];

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

		long sum = 1L;
		long max = 1000000000000000000L;
		for (int i = 0; i < n; i++) {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(sum);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String str[] = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " long a[] = new long[n]; a new long[n] n for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			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] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		} {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		} a[i] = Long.parseLong(str[i]) a[i] a i Long.parseLong(str[i]) Long.parseLong Long str[i] str i 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 sum = 1L; sum 1L long max = 1000000000000000000L; max 1000000000000000000L for (int i = 0; i < n; i++) {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			} a[i] <= max / sum a[i] a i max / sum max sum {
				sum *= a[i];
			} sum *= a[i] sum 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(sum) System.out.println System.out System System.out sum String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");

		long a[] = new long[n];

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

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

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");

		long a[] = new long[n];

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

		long sum = 1L;
		long max = 1000000000000000000L;
		for (int i = 0; i < n; i++) {
			if (a[i] <= max / sum) {
				sum *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		System.out.println(sum);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");

		long a[] = new long[n];

		for (int i = 0; i < n; i++) {
			a[i] = Long.parseLong(str[i]);

			if (a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

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