

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		long ans = 1 ;
		long[] a = new long[n];
		long max = (long)Math.pow(10, 18);

		for(int i=0 ; i<n ; i++) {
			 a[i] = scanner.nextLong();
		}

		for(int i=0 ; i<n ; i++) {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		}

		System.out.println(ans);

		scanner.close();

	}

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

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		long ans = 1 ;
		long[] a = new long[n];
		long max = (long)Math.pow(10, 18);

		for(int i=0 ; i<n ; i++) {
			 a[i] = scanner.nextLong();
		}

		for(int i=0 ; i<n ; i++) {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		}

		System.out.println(ans);

		scanner.close();

	}

} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		long ans = 1 ;
		long[] a = new long[n];
		long max = (long)Math.pow(10, 18);

		for(int i=0 ; i<n ; i++) {
			 a[i] = scanner.nextLong();
		}

		for(int i=0 ; i<n ; i++) {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		}

		System.out.println(ans);

		scanner.close();

	} main {

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		long ans = 1 ;
		long[] a = new long[n];
		long max = (long)Math.pow(10, 18);

		for(int i=0 ; i<n ; i++) {
			 a[i] = scanner.nextLong();
		}

		for(int i=0 ; i<n ; i++) {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		}

		System.out.println(ans);

		scanner.close();

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

		} int i=0 ; int i=0 ; i 0 i<n i n i++ i++ i {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		} {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		} if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				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 *= a[i];
			} a[i] > (max/ans) a[i] a i (max/ans) max ans {
				ans = -1;
			} ans = -1 ans -1 1 {
				ans *= a[i];
			} ans *= a[i] ans a[i] a i System.out.println(ans) System.out.println System.out System System.out ans scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		long ans = 1 ;
		long[] a = new long[n];
		long max = (long)Math.pow(10, 18);

		for(int i=0 ; i<n ; i++) {
			 a[i] = scanner.nextLong();
		}

		for(int i=0 ; i<n ; i++) {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		}

		System.out.println(ans);

		scanner.close();

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		long ans = 1 ;
		long[] a = new long[n];
		long max = (long)Math.pow(10, 18);

		for(int i=0 ; i<n ; i++) {
			 a[i] = scanner.nextLong();
		}

		for(int i=0 ; i<n ; i++) {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		}

		System.out.println(ans);

		scanner.close();

	}

} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		long ans = 1 ;
		long[] a = new long[n];
		long max = (long)Math.pow(10, 18);

		for(int i=0 ; i<n ; i++) {
			 a[i] = scanner.nextLong();
		}

		for(int i=0 ; i<n ; i++) {
			if(a[i]==0) {
				ans = 0;
				break;
			}else if(a[i] > (max/ans)) {
				ans = -1;
			}else {
				ans *= a[i];
			}

		}

		System.out.println(ans);

		scanner.close();

	}

}
