
import java.util.Scanner;


public class Main {

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

		Scanner scan = new java.util.Scanner(System.in);

		int n = scan.nextInt();
		long[] a = new long[n];


		for(int i=0;i<n;i++) {

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

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

if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c);

	scan.close();

	}

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

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

		Scanner scan = new java.util.Scanner(System.in);

		int n = scan.nextInt();
		long[] a = new long[n];


		for(int i=0;i<n;i++) {

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

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

if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c);

	scan.close();

	}

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

		Scanner scan = new java.util.Scanner(System.in);

		int n = scan.nextInt();
		long[] a = new long[n];


		for(int i=0;i<n;i++) {

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

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

if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c);

	scan.close();

	} main {
		// TODO 自動生成されたメソッド・スタブ

		Scanner scan = new java.util.Scanner(System.in);

		int n = scan.nextInt();
		long[] a = new long[n];


		for(int i=0;i<n;i++) {

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

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

if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c);

	scan.close();

	} Scanner scan = new java.util.Scanner(System.in); scan new java.util.Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan long[] a = new long[n]; a new long[n] n for(int i=0;i<n;i++) {

			 a[i] = scan.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] = scan.nextLong();
			 if(a[i]==0) {
				 System.out.println(0);
				 return;
			 }
		} {

			 a[i] = scan.nextLong();
			 if(a[i]==0) {
				 System.out.println(0);
				 return;
			 }
		} a[i] = scan.nextLong() a[i] a i scan.nextLong() scan.nextLong scan 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 c =1; c 1 for(int i=0;i<n;i++) {
	if(a[i] <= 1000000000000000000L / c)
		c *= 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] <= 1000000000000000000L / c)
		c *= a[i];
	else {
		System.out.println(-1);
		return;
	}
} {
	if(a[i] <= 1000000000000000000L / c)
		c *= a[i];
	else {
		System.out.println(-1);
		return;
	}
} if(a[i] <= 1000000000000000000L / c)
		c *= a[i];
	else {
		System.out.println(-1);
		return;
	} a[i] <= 1000000000000000000L / c a[i] a i 1000000000000000000L / c 1000000000000000000L c c *= a[i] c a[i] a i {
		System.out.println(-1);
		return;
	} System.out.println(-1) System.out.println System.out System System.out -1 1 return; if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c); c > 1000000000000000000L c 1000000000000000000L System.out.println(-1) System.out.println System.out System System.out -1 1 System.out.println(c) System.out.println System.out System System.out c scan.close() scan.close scan String[] args args public class Main {

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

		Scanner scan = new java.util.Scanner(System.in);

		int n = scan.nextInt();
		long[] a = new long[n];


		for(int i=0;i<n;i++) {

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

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

if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c);

	scan.close();

	}

} public class Main {

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

		Scanner scan = new java.util.Scanner(System.in);

		int n = scan.nextInt();
		long[] a = new long[n];


		for(int i=0;i<n;i++) {

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

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

if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c);

	scan.close();

	}

} Main

import java.util.Scanner;


public class Main {

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

		Scanner scan = new java.util.Scanner(System.in);

		int n = scan.nextInt();
		long[] a = new long[n];


		for(int i=0;i<n;i++) {

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

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

if(c > 1000000000000000000L)
			System.out.println(-1);
else
	System.out.println(c);

	scan.close();

	}

}
