import java.util.Scanner;

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

public class Main {
  static final long MAX_NUMBER = 1000000000000000000L;
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long answer = 1l;
    int n = sc.nextInt();
    long[] values = new long[n];
    for(int i = 0; i < n; i++) {
      values[i] = sc.nextLong();
      if(values[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0; i < n; i++) {
      long tmp = values[i];
      if(MAX_NUMBER / tmp < answer){
        System.out.println(-1);
        return;
      } else {
        answer *= tmp;
      }
    }
    System.out.println(answer);
  }
}