import java.math.BigDecimal;
import java.util.Scanner;

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

		int N = sc.nextInt();
		long ans = 1;
		long[] A = new long[N];

		for(int i=0; i<N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		}

		for(int i=0; i<N; i++) {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		}


		if(ans <= 1000000000000000000l) {
			System.out.println(ans);
		}else {
			System.out.println(-1);
		}

	}
}
 import java.math.BigDecimal; BigDecimal java.math import java.util.Scanner; Scanner java.util class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		long ans = 1;
		long[] A = new long[N];

		for(int i=0; i<N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		}

		for(int i=0; i<N; i++) {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		}


		if(ans <= 1000000000000000000l) {
			System.out.println(ans);
		}else {
			System.out.println(-1);
		}

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

		int N = sc.nextInt();
		long ans = 1;
		long[] A = new long[N];

		for(int i=0; i<N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		}

		for(int i=0; i<N; i++) {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		}


		if(ans <= 1000000000000000000l) {
			System.out.println(ans);
		}else {
			System.out.println(-1);
		}

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

		int N = sc.nextInt();
		long ans = 1;
		long[] A = new long[N];

		for(int i=0; i<N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		}

		for(int i=0; i<N; i++) {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		}


		if(ans <= 1000000000000000000l) {
			System.out.println(ans);
		}else {
			System.out.println(-1);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long ans = 1; ans 1 long[] A = new long[N]; A new long[N] N for(int i=0; i<N; i++) {
			A[i] = sc.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] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		} {
			A[i] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		} A[i] = sc.nextLong() A[i] A i sc.nextLong() sc.nextLong sc 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 ; for(int i=0; i<N; i++) {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		} {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		} long a = A[i]; a A[i] A i if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			} Math.log10(ans) + Math.log10(a) > 18 Math.log10(ans) + Math.log10(a) Math.log10(ans) Math.log10 Math ans Math.log10(a) Math.log10 Math a 18 {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; ans *= a ans a if(ans <= 1000000000000000000l) {
			System.out.println(ans);
		}else {
			System.out.println(-1);
		} ans <= 1000000000000000000l ans 1000000000000000000l {
			System.out.println(ans);
		} System.out.println(ans) System.out.println System.out System System.out ans {
			System.out.println(-1);
		} System.out.println(-1) System.out.println System.out System System.out -1 1 String[] args args
import java.math.BigDecimal;
import java.util.Scanner;

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

		int N = sc.nextInt();
		long ans = 1;
		long[] A = new long[N];

		for(int i=0; i<N; i++) {
			A[i] = sc.nextLong();
			if(A[i] == 0) {
				System.out.println(0);
				return ;
			}
		}

		for(int i=0; i<N; i++) {
			long a = A[i];
			if(Math.log10(ans) + Math.log10(a) > 18) {
				System.out.println(-1);
				return;
			}
			ans *= a;

		}


		if(ans <= 1000000000000000000l) {
			System.out.println(ans);
		}else {
			System.out.println(-1);
		}

	}
}

