import java.util.Scanner;

public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    long[] A=new long[N];
	    
	    long m=1;
	    for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    }
	    
	    for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    }

	    	System.out.print(m);

//        if (flg) {
//        	System.out.print("YES");
//        }else {
//        	System.out.print("NO");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
} import java.util.Scanner; Scanner java.util public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    long[] A=new long[N];
	    
	    long m=1;
	    for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    }
	    
	    for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    }

	    	System.out.print(m);

//        if (flg) {
//        	System.out.print("YES");
//        }else {
//        	System.out.print("NO");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
} Main static Scanner scanner; scanner public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    long[] A=new long[N];
	    
	    long m=1;
	    for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    }
	    
	    for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    }

	    	System.out.print(m);

//        if (flg) {
//        	System.out.print("YES");
//        }else {
//        	System.out.print("NO");
//        }


	} main {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    long[] A=new long[N];
	    
	    long m=1;
	    for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    }
	    
	    for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    }

	    	System.out.print(m);

//        if (flg) {
//        	System.out.print("YES");
//        }else {
//        	System.out.print("NO");
//        }


	} scanner = new Scanner(System.in) scanner new Scanner(System.in) int N=gi(); N gi() gi long[] A=new long[N]; A new long[N] N long m=1; m 1 for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    } {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    } A[i]=gl() A[i] A i gl() gl if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	} A[i]==0 A[i] A i 0 {
	    		System.out.print("0");
	    		return;
	    	} System.out.print("0") System.out.print System.out System System.out "0" return; for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    } {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    } if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	} Math.floorDiv(1000000000000000000l, m)<A[i] Math.floorDiv(1000000000000000000l, m) Math.floorDiv Math 1000000000000000000l m A[i] A i {
	    		System.out.print("-1");
	    		return;
	    	} System.out.print("-1") System.out.print System.out System System.out "-1" return; m*=A[i] m A[i] A i System.out.print(m) System.out.print System.out System System.out m String[] args args // 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	} gs {
		return scanner.next();
	} return scanner.next(); scanner.next() scanner.next scanner // intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	} gi {
		return Integer.parseInt(scanner.next());
	} return Integer.parseInt(scanner.next()); Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner // longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	} gl {
		return Long.parseLong(scanner.next());
	} return Long.parseLong(scanner.next()); Long.parseLong(scanner.next()) Long.parseLong Long scanner.next() scanner.next scanner // doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	} gd {
		return Double.parseDouble(scanner.next());
	} return Double.parseDouble(scanner.next()); Double.parseDouble(scanner.next()) Double.parseDouble Double scanner.next() scanner.next scanner public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    long[] A=new long[N];
	    
	    long m=1;
	    for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    }
	    
	    for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    }

	    	System.out.print(m);

//        if (flg) {
//        	System.out.print("YES");
//        }else {
//        	System.out.print("NO");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
} public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    long[] A=new long[N];
	    
	    long m=1;
	    for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    }
	    
	    for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    }

	    	System.out.print(m);

//        if (flg) {
//        	System.out.print("YES");
//        }else {
//        	System.out.print("NO");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
} Main
import java.util.Scanner;

public class Main {

	static Scanner scanner;

	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int N=gi();
	    long[] A=new long[N];
	    
	    long m=1;
	    for (int i=0; i<N; i++) {
	    	A[i]=gl();
	    	if(A[i]==0) {
	    		System.out.print("0");
	    		return;
	    	}
	    }
	    
	    for (int i=0; i<N; i++) {
	    	if (Math.floorDiv(1000000000000000000l, m)<A[i]) {
	    		System.out.print("-1");
	    		return;
	    	}
	    	m*=A[i];
	    }

	    	System.out.print(m);

//        if (flg) {
//        	System.out.print("YES");
//        }else {
//        	System.out.print("NO");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}