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];
		long all = 1;
        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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		}

			System.out.println(all);


	}

}

 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];
		long all = 1;
        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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		}

			System.out.println(all);


	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		long all = 1;
        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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		}

			System.out.println(all);


	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		long all = 1;
        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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		}

			System.out.println(all);


	} 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 long all = 1; all 1 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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		} {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		} if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          } 1000000000000000000L / all < a[i] 1000000000000000000L / all 1000000000000000000L all a[i] a i {
            System.out.println(-1);
			return;
          } System.out.println(-1) System.out.println System.out System System.out -1 1 return; all *= a[i] all a[i] a i if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		} all > 1000000000000000000L all 1000000000000000000L {
			System.out.println(-1);
			return;
		} System.out.println(-1) System.out.println System.out System System.out -1 1 return; System.out.println(all) System.out.println System.out System System.out all 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];
		long all = 1;
        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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		}

			System.out.println(all);


	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[] a = new long[n];
		long all = 1;
        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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		}

			System.out.println(all);


	}

} 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];
		long all = 1;
        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++) {
          if(1000000000000000000L / all < a[i]) {
            System.out.println(-1);
			return;
          }
			all *= a[i];
          if(all > 1000000000000000000L) {
			System.out.println(-1);
			return;
		}
		}

			System.out.println(all);


	}

}


