import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		long[] a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		
		long sum = 1;
		long max = 1000000000000000000l;
		boolean chk = false;
		boolean zero = false;
		
		for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		}
		
		if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		long[] a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		
		long sum = 1;
		long max = 1000000000000000000l;
		boolean chk = false;
		boolean zero = false;
		
		for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		}
		
		if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		long[] a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		
		long sum = 1;
		long max = 1000000000000000000l;
		boolean chk = false;
		boolean zero = false;
		
		for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		}
		
		if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		long[] a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		
		long sum = 1;
		long max = 1000000000000000000l;
		boolean chk = false;
		boolean zero = false;
		
		for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		}
		
		if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long[] a = new long[n]; a new long[n] n for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			a[i] = sc.nextLong();
		} {
			a[i] = sc.nextLong();
		} a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc long sum = 1; sum 1 long max = 1000000000000000000l; max 1000000000000000000l boolean chk = false; chk false boolean zero = false; zero false for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		} {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		} if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			} sum!= 0 && max / sum < a[i] sum!= 0 sum 0 max / sum < a[i] max / sum max sum a[i] a i {
				chk = true;
			} chk = true chk true if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			} a[i] == 0 a[i] a i 0 {
				sum = 0;
				zero = true;
				break;
			} sum = 0 sum 0 zero = true zero true break; {
				sum*= a[i];
			} sum*= a[i] sum a[i] a i if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		} zero {
			System.out.println(0);
		} System.out.println(0) System.out.println System.out System System.out 0 if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		} chk {
			System.out.println(-1);
		} System.out.println(-1) System.out.println System.out System System.out -1 1 {
			System.out.println(sum);
		} System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		long[] a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		
		long sum = 1;
		long max = 1000000000000000000l;
		boolean chk = false;
		boolean zero = false;
		
		for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		}
		
		if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		long[] a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		
		long sum = 1;
		long max = 1000000000000000000l;
		boolean chk = false;
		boolean zero = false;
		
		for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		}
		
		if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		long[] a = new long[n];
		
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
		}
		
		long sum = 1;
		long max = 1000000000000000000l;
		boolean chk = false;
		boolean zero = false;
		
		for(int i = 0; i < n; i++) {
			if(sum!= 0 && max / sum < a[i]) {
				chk = true;
			}
			if(a[i] == 0) {
				sum = 0;
				zero = true;
				break;
			}else {
				sum*= a[i];
			}
		}
		
		if( zero ) {
			System.out.println(0);
		}else if( chk ){
			System.out.println(-1);
		}else {
			System.out.println(sum);
		}
	}
}