import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	long[] a = new long[n];
        long std = 1000000000000000000L;
      	for (int i=0; i < n; i++) {
          a[i]= sc.nextLong();
          if (a[i] == 0) {
            System.out.println(0);
            return;
          }
        }
      
        long seki = a[0];
        for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        }
        System.out.println(seki);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	long[] a = new long[n];
        long std = 1000000000000000000L;
      	for (int i=0; i < n; i++) {
          a[i]= sc.nextLong();
          if (a[i] == 0) {
            System.out.println(0);
            return;
          }
        }
      
        long seki = a[0];
        for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        }
        System.out.println(seki);
    }
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	long[] a = new long[n];
        long std = 1000000000000000000L;
      	for (int i=0; i < n; i++) {
          a[i]= sc.nextLong();
          if (a[i] == 0) {
            System.out.println(0);
            return;
          }
        }
      
        long seki = a[0];
        for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        }
        System.out.println(seki);
    } main {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	long[] a = new long[n];
        long std = 1000000000000000000L;
      	for (int i=0; i < n; i++) {
          a[i]= sc.nextLong();
          if (a[i] == 0) {
            System.out.println(0);
            return;
          }
        }
      
        long seki = a[0];
        for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        }
        System.out.println(seki);
    } 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 std = 1000000000000000000L; std 1000000000000000000L 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 seki = a[0]; seki a[0] a 0 for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        } int i=1; int i=1; i 1 i < n i n i++ i++ i {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        } {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        } if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          } a[i] <= (std / seki) a[i] a i (std / seki) std seki {
            seki *= a[i];
          } seki *= a[i] seki 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(seki) System.out.println System.out System System.out seki String[] args args public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	long[] a = new long[n];
        long std = 1000000000000000000L;
      	for (int i=0; i < n; i++) {
          a[i]= sc.nextLong();
          if (a[i] == 0) {
            System.out.println(0);
            return;
          }
        }
      
        long seki = a[0];
        for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        }
        System.out.println(seki);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	long[] a = new long[n];
        long std = 1000000000000000000L;
      	for (int i=0; i < n; i++) {
          a[i]= sc.nextLong();
          if (a[i] == 0) {
            System.out.println(0);
            return;
          }
        }
      
        long seki = a[0];
        for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        }
        System.out.println(seki);
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	long[] a = new long[n];
        long std = 1000000000000000000L;
      	for (int i=0; i < n; i++) {
          a[i]= sc.nextLong();
          if (a[i] == 0) {
            System.out.println(0);
            return;
          }
        }
      
        long seki = a[0];
        for(int i=1; i < n; i++) {
          if (a[i] <= (std / seki)) {
            seki *= a[i];
          } else {
            System.out.println(-1);
          	return;
          }
        }
        System.out.println(seki);
    }
}