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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	Scanner scan =new Scanner(System.in);
	int N=scan.nextInt();
	long num[]=new long[N];
	long answer=1;
	long max =1000000000000000000L;
		for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		}
		Arrays.sort(num);
		for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		}
		System.out.println(answer);
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	Scanner scan =new Scanner(System.in);
	int N=scan.nextInt();
	long num[]=new long[N];
	long answer=1;
	long max =1000000000000000000L;
		for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		}
		Arrays.sort(num);
		for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		}
		System.out.println(answer);
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	Scanner scan =new Scanner(System.in);
	int N=scan.nextInt();
	long num[]=new long[N];
	long answer=1;
	long max =1000000000000000000L;
		for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		}
		Arrays.sort(num);
		for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		}
		System.out.println(answer);
	} main {
		// TODO 自動生成されたメソッド・スタブ
	Scanner scan =new Scanner(System.in);
	int N=scan.nextInt();
	long num[]=new long[N];
	long answer=1;
	long max =1000000000000000000L;
		for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		}
		Arrays.sort(num);
		for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		}
		System.out.println(answer);
	} Scanner scan =new Scanner(System.in); scan new Scanner(System.in) int N=scan.nextInt(); N scan.nextInt() scan.nextInt scan long num[]=new long[N]; num new long[N] N long answer=1; answer 1 long max =1000000000000000000L; max 1000000000000000000L for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			num[i]=scan.nextLong();
		} {
			num[i]=scan.nextLong();
		} num[i]=scan.nextLong() num[i] num i scan.nextLong() scan.nextLong scan Arrays.sort(num) Arrays.sort Arrays num for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		} Long tmp num {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		} {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		} if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			} tmp==0 tmp 0 {
				answer=0;
				break;
			} answer=0 answer 0 break; if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			} tmp<=(max/answer) tmp (max/answer) max answer {
				answer*=tmp;
			} answer*=tmp answer tmp {
				answer =-1;
				break;
			} answer =-1 answer -1 1 break; System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	Scanner scan =new Scanner(System.in);
	int N=scan.nextInt();
	long num[]=new long[N];
	long answer=1;
	long max =1000000000000000000L;
		for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		}
		Arrays.sort(num);
		for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		}
		System.out.println(answer);
	}
} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	Scanner scan =new Scanner(System.in);
	int N=scan.nextInt();
	long num[]=new long[N];
	long answer=1;
	long max =1000000000000000000L;
		for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		}
		Arrays.sort(num);
		for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		}
		System.out.println(answer);
	}
} Main
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
	Scanner scan =new Scanner(System.in);
	int N=scan.nextInt();
	long num[]=new long[N];
	long answer=1;
	long max =1000000000000000000L;
		for(int i=0;i<N;i++) {
			num[i]=scan.nextLong();
		}
		Arrays.sort(num);
		for(Long tmp:num) {
			if(tmp==0) {
				answer=0;
				break;
			}else if(tmp<=(max/answer)) {
				answer*=tmp;
			}else {
				answer =-1;
				break;
			}
		}
		System.out.println(answer);
	}
}
