import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		
		int input = in.nextInt();
		long[] a = new long[input];
		long max = (long)Math.pow(10, 18);
		long ans = 1;
		for(int i = 0;i<input;i++) {
			a[i] = in.nextLong();
		}
		for(int i = 0;i<input;i++) {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	}
		System.out.println(ans);

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

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		
		int input = in.nextInt();
		long[] a = new long[input];
		long max = (long)Math.pow(10, 18);
		long ans = 1;
		for(int i = 0;i<input;i++) {
			a[i] = in.nextLong();
		}
		for(int i = 0;i<input;i++) {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	}
		System.out.println(ans);

 
 }
} Main public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		
		int input = in.nextInt();
		long[] a = new long[input];
		long max = (long)Math.pow(10, 18);
		long ans = 1;
		for(int i = 0;i<input;i++) {
			a[i] = in.nextLong();
		}
		for(int i = 0;i<input;i++) {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	}
		System.out.println(ans);

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

 
 } Scanner in = new Scanner(System.in); in new Scanner(System.in) int input = in.nextInt(); input in.nextInt() in.nextInt in long[] a = new long[input]; a new long[input] input long max = (long)Math.pow(10, 18); max (long)Math.pow(10, 18) Math.pow Math 10 18 long ans = 1; ans 1 for(int i = 0;i<input;i++) {
			a[i] = in.nextLong();
		} int i = 0; int i = 0; i 0 i<input i input i++ i++ i {
			a[i] = in.nextLong();
		} {
			a[i] = in.nextLong();
		} a[i] = in.nextLong() a[i] a i in.nextLong() in.nextLong in for(int i = 0;i<input;i++) {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	} int i = 0; int i = 0; i 0 i<input i input i++ i++ i {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	} {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	} if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		} a[i] == 0 a[i] a i 0 {
			ans = 0;
			break;
		} ans = 0 ans 0 break; if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		} a[i]>(max/ans) a[i] a i (max/ans) max ans {
			ans = -1;
		} ans = -1 ans -1 1 {
			ans = ans * a[i];
		} ans = ans * a[i] ans ans * a[i] ans a[i] a i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		
		int input = in.nextInt();
		long[] a = new long[input];
		long max = (long)Math.pow(10, 18);
		long ans = 1;
		for(int i = 0;i<input;i++) {
			a[i] = in.nextLong();
		}
		for(int i = 0;i<input;i++) {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	}
		System.out.println(ans);

 
 }
} public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		
		int input = in.nextInt();
		long[] a = new long[input];
		long max = (long)Math.pow(10, 18);
		long ans = 1;
		for(int i = 0;i<input;i++) {
			a[i] = in.nextLong();
		}
		for(int i = 0;i<input;i++) {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	}
		System.out.println(ans);

 
 }
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		
		int input = in.nextInt();
		long[] a = new long[input];
		long max = (long)Math.pow(10, 18);
		long ans = 1;
		for(int i = 0;i<input;i++) {
			a[i] = in.nextLong();
		}
		for(int i = 0;i<input;i++) {
		if(a[i] == 0) {
			ans = 0;
			break;
		}
		else if(a[i]>(max/ans)) {
			ans = -1;
		}
		else {
			ans = ans * a[i];
		}
		
		
	}
		System.out.println(ans);

 
 }
}
