
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		int N = scanner.nextInt();
		long ans = 1;
		long max = (long)Math.pow(10, 18);

		for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		}

		System.out.println(ans);

		scanner.close();

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		int N = scanner.nextInt();
		long ans = 1;
		long max = (long)Math.pow(10, 18);

		for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		}

		System.out.println(ans);

		scanner.close();

	}

} Main public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		int N = scanner.nextInt();
		long ans = 1;
		long max = (long)Math.pow(10, 18);

		for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		}

		System.out.println(ans);

		scanner.close();

	} main {

		Scanner scanner=new Scanner(System.in);
		int N = scanner.nextInt();
		long ans = 1;
		long max = (long)Math.pow(10, 18);

		for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		}

		System.out.println(ans);

		scanner.close();

	} Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner long ans = 1; ans 1 long max = (long)Math.pow(10, 18); max (long)Math.pow(10, 18) Math.pow Math 10 18 for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		} int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		} {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		} long a = scanner.nextLong(); a scanner.nextLong() scanner.nextLong scanner if(a == 0) {
				ans = 0;
				break;
			} a == 0 a 0 {
				ans = 0;
				break;
			} ans = 0 ans 0 break; if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			} max / ans >= a max / ans max ans a {
				ans *= a;
			} ans *= a ans a {
				ans = -1;
			} ans = -1 ans -1 1 System.out.println(ans) System.out.println System.out System System.out ans scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		int N = scanner.nextInt();
		long ans = 1;
		long max = (long)Math.pow(10, 18);

		for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		}

		System.out.println(ans);

		scanner.close();

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		int N = scanner.nextInt();
		long ans = 1;
		long max = (long)Math.pow(10, 18);

		for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		}

		System.out.println(ans);

		scanner.close();

	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner=new Scanner(System.in);
		int N = scanner.nextInt();
		long ans = 1;
		long max = (long)Math.pow(10, 18);

		for(int i = 0 ; i < N ; i++) {
			long a = scanner.nextLong();
			if(a == 0) {
				ans = 0;
				break;
			}
			if(max / ans >= a) {
				ans *= a;
			}else {
				ans = -1;
			}

		}

		System.out.println(ans);

		scanner.close();

	}

}
