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();
			if(A[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long SUM = 1l;

		for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		}


		System.out.println(SUM);
		sc.close();
	}
} 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();
			if(A[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long SUM = 1l;

		for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		}


		System.out.println(SUM);
		sc.close();
	}
} 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();
			if(A[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long SUM = 1l;

		for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		}


		System.out.println(SUM);
		sc.close();
	} 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();
			if(A[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long SUM = 1l;

		for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		}


		System.out.println(SUM);
		sc.close();
	} 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();
			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; long SUM = 1l; SUM 1l for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		} long I A {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		} {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		} if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			} 1000000000000000000L / I >= SUM 1000000000000000000L / I 1000000000000000000L I SUM {
				SUM *= I;
			} SUM *= I SUM I {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(SUM) System.out.println System.out System System.out SUM sc.close() sc.close sc 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();
			if(A[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long SUM = 1l;

		for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		}


		System.out.println(SUM);
		sc.close();
	}
} 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();
			if(A[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long SUM = 1l;

		for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		}


		System.out.println(SUM);
		sc.close();
	}
} 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();
			if(A[i] == 0) {
				System.out.println(0);
				return;
			}
		}

		long SUM = 1l;

		for (long I: A) {
			if (1000000000000000000L / I >= SUM) {
				SUM *= I;
			} else {
				System.out.println(-1);
				return;
			}
		}


		System.out.println(SUM);
		sc.close();
	}
}