import java.util.Scanner;


public class Main {
		public static void main (String args[]) throws Exception{
		Scanner scan = new Scanner(System.in);
		int  n = scan.nextInt();
		long a[] = new long[n];
		Long max = Long.parseLong("1000000000000000000");
		// 0が含まれる場合
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextLong();
			if(a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long ans = a[0];
		for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} 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[]) throws Exception{
		Scanner scan = new Scanner(System.in);
		int  n = scan.nextInt();
		long a[] = new long[n];
		Long max = Long.parseLong("1000000000000000000");
		// 0が含まれる場合
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextLong();
			if(a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long ans = a[0];
		for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		}
		System.out.println(ans);
	}
} Main public static void main (String args[]) throws Exception{
		Scanner scan = new Scanner(System.in);
		int  n = scan.nextInt();
		long a[] = new long[n];
		Long max = Long.parseLong("1000000000000000000");
		// 0が含まれる場合
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextLong();
			if(a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long ans = a[0];
		for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		}
		System.out.println(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int  n = scan.nextInt();
		long a[] = new long[n];
		Long max = Long.parseLong("1000000000000000000");
		// 0が含まれる場合
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextLong();
			if(a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long ans = a[0];
		for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		}
		System.out.println(ans);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int  n = scan.nextInt(); n scan.nextInt() scan.nextInt scan long a[] = new long[n]; a new long[n] n Long max = Long.parseLong("1000000000000000000"); max Long.parseLong("1000000000000000000") Long.parseLong Long "1000000000000000000" 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 ans = a[0]; ans a[0] a 0 for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		} int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		} {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		} if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			} ans > max / a[i] ans max / a[i] max a[i] a i {
				ans = -1;
				break;
			} ans = -1 ans -1 1 break; {
				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[]) throws Exception{
		Scanner scan = new Scanner(System.in);
		int  n = scan.nextInt();
		long a[] = new long[n];
		Long max = Long.parseLong("1000000000000000000");
		// 0が含まれる場合
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextLong();
			if(a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long ans = a[0];
		for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		}
		System.out.println(ans);
	}
} public class Main {
		public static void main (String args[]) throws Exception{
		Scanner scan = new Scanner(System.in);
		int  n = scan.nextInt();
		long a[] = new long[n];
		Long max = Long.parseLong("1000000000000000000");
		// 0が含まれる場合
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextLong();
			if(a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long ans = a[0];
		for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;


public class Main {
		public static void main (String args[]) throws Exception{
		Scanner scan = new Scanner(System.in);
		int  n = scan.nextInt();
		long a[] = new long[n];
		Long max = Long.parseLong("1000000000000000000");
		// 0が含まれる場合
		for(int i = 0; i < n; i++) {
			a[i] = scan.nextLong();
			if(a[i] == 0) {
				System.out.println(0);
				return;
			}
		}
		long ans = a[0];
		for(int i = 1; i < n; i++) {
			if(ans > max / a[i]) {
				ans = -1;
				break;
			} else {
				ans = ans * a[i];
			}
		}
		System.out.println(ans);
	}
}