import java.util.*;
import java.io.*;
 
class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long result = 1;
    boolean flag = true;
    long num = 1000000000000000000l;
    long[] arr = new long[n];
    
    for(int i = 0; i < n; i++) {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    }
    Arrays.sort(arr);
    for(int i = 0; i < n; i++) {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    }
    
    if(flag) System.out.println(result);
    else System.out.println(-1);
  }
} import java.util.*; util.* java import java.io.*; io.* java class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long result = 1;
    boolean flag = true;
    long num = 1000000000000000000l;
    long[] arr = new long[n];
    
    for(int i = 0; i < n; i++) {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    }
    Arrays.sort(arr);
    for(int i = 0; i < n; i++) {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    }
    
    if(flag) System.out.println(result);
    else System.out.println(-1);
  }
} Main public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long result = 1;
    boolean flag = true;
    long num = 1000000000000000000l;
    long[] arr = new long[n];
    
    for(int i = 0; i < n; i++) {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    }
    Arrays.sort(arr);
    for(int i = 0; i < n; i++) {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    }
    
    if(flag) System.out.println(result);
    else System.out.println(-1);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long result = 1;
    boolean flag = true;
    long num = 1000000000000000000l;
    long[] arr = new long[n];
    
    for(int i = 0; i < n; i++) {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    }
    Arrays.sort(arr);
    for(int i = 0; i < n; i++) {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    }
    
    if(flag) System.out.println(result);
    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 result = 1; result 1 boolean flag = true; flag true long num = 1000000000000000000l; num 1000000000000000000l long[] arr = new long[n]; arr new long[n] n for(int i = 0; i < n; i++) {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    } {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    } arr[i] = sc.nextLong() arr[i] arr i sc.nextLong() sc.nextLong sc if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        } arr[i] == 0 arr[i] arr i 0 {
            System.out.println(0);
            System.exit(0);
        } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 Arrays.sort(arr) Arrays.sort Arrays arr for(int i = 0; i < n; i++) {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    } {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    } if(flag) result = result*arr[i]; flag result = result*arr[i] result result*arr[i] result arr[i] arr i if(result > num || result < 1) flag = false; result > num || result < 1 result > num result num result < 1 result 1 flag = false flag false if(flag) System.out.println(result);
    else System.out.println(-1); flag System.out.println(result) System.out.println System.out System System.out result System.out.println(-1) System.out.println System.out System System.out -1 1 String[]args args
import java.util.*;
import java.io.*;
 
class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long result = 1;
    boolean flag = true;
    long num = 1000000000000000000l;
    long[] arr = new long[n];
    
    for(int i = 0; i < n; i++) {
        arr[i] = sc.nextLong();
        if (arr[i] == 0) {
            System.out.println(0);
            System.exit(0);
        }
    }
    Arrays.sort(arr);
    for(int i = 0; i < n; i++) {
      	if(flag) result = result*arr[i];
      	if(result > num || result < 1) flag = false;
    }
    
    if(flag) System.out.println(result);
    else System.out.println(-1);
  }
}