import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long sum = 1;
    long max = 1000000000000000000L;
    boolean isMax = false;

    for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    }
    System.out.println(sum);
  }
} 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 sum = 1;
    long max = 1000000000000000000L;
    boolean isMax = false;

    for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    }
    System.out.println(sum);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long sum = 1;
    long max = 1000000000000000000L;
    boolean isMax = false;

    for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    }
    System.out.println(sum);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long sum = 1;
    long max = 1000000000000000000L;
    boolean isMax = false;

    for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    }
    System.out.println(sum);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long sum = 1; sum 1 long max = 1000000000000000000L; max 1000000000000000000L boolean isMax = false; isMax false for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    } {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    } long a = sc.nextLong(); a sc.nextLong() sc.nextLong sc if (a== 0) {
        sum = 0;
        break;
      } a== 0 a 0 {
        sum = 0;
        break;
      } sum = 0 sum 0 break; if (!isMax) {
        sum *= a;
      } !isMax isMax {
        sum *= a;
      } sum *= a sum a if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      } sum > max || sum == 0 sum > max sum max sum == 0 sum 0 {
        sum = -1;
        isMax = true;
      } sum = -1 sum -1 1 isMax = true isMax true System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long sum = 1;
    long max = 1000000000000000000L;
    boolean isMax = false;

    for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    }
    System.out.println(sum);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long sum = 1;
    long max = 1000000000000000000L;
    boolean isMax = false;

    for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    }
    System.out.println(sum);
  }
} 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 sum = 1;
    long max = 1000000000000000000L;
    boolean isMax = false;

    for (int i = 0; i < n; i++) {
      long a = sc.nextLong();
      if (a== 0) {
        sum = 0;
        break;
      }
      if (!isMax) {
        sum *= a;
      }
      if (sum > max || sum == 0) {
        sum = -1;
        isMax = true;
      }
    }
    System.out.println(sum);
  }
}