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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		}
		
		long prod = 1;
		
		for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(prod);
		
		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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		}
		
		long prod = 1;
		
		for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(prod);
		
		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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		}
		
		long prod = 1;
		
		for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(prod);
		
		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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		}
		
		long prod = 1;
		
		for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(prod);
		
		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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		} {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		} long l = sc.nextLong(); l sc.nextLong() sc.nextLong sc if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			} l == 0 l 0 {
				System.out.println(0);
				return;
			} System.out.println(0) System.out.println System.out System System.out 0 return; {
				a[i] = l;
			} a[i] = l a[i] a i l long prod = 1; prod 1 for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		} if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			} a[i] <= (long)Math.pow(10, 18) / prod a[i] a i (long)Math.pow(10, 18) / prod (long)Math.pow(10, 18) Math.pow Math 10 18 prod {
				prod *= a[i];
			} prod *= a[i] prod a[i] a i {
				System.out.println(-1);
				return;
			} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(prod) System.out.println System.out System System.out prod 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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		}
		
		long prod = 1;
		
		for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(prod);
		
		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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		}
		
		long prod = 1;
		
		for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(prod);
		
		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++) {
			long l = sc.nextLong();
			
			if (l == 0) {
				System.out.println(0);
				return;
			} else {
				a[i] = l;
			}
		}
		
		long prod = 1;
		
		for (int i = 0; i < n; i++) {
			if (a[i] <= (long)Math.pow(10, 18) / prod) {
				prod *= a[i];
			} else {
				System.out.println(-1);
				return;
			}
		}
		
		System.out.println(prod);
		
		sc.close();
	}
}


