import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    long max = 1000000000000000000L;
    long ans = 1;
    boolean of = false;
    for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      }
    System.out.println(of? -1 : ans);

    sc.close();
  }
} 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 max = 1000000000000000000L;
    long ans = 1;
    boolean of = false;
    for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      }
    System.out.println(of? -1 : ans);

    sc.close();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    long max = 1000000000000000000L;
    long ans = 1;
    boolean of = false;
    for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      }
    System.out.println(of? -1 : ans);

    sc.close();
  } main {
    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    long max = 1000000000000000000L;
    long ans = 1;
    boolean of = false;
    for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      }
    System.out.println(of? -1 : ans);

    sc.close();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc long max = 1000000000000000000L; max 1000000000000000000L long ans = 1; ans 1 boolean of = false; of false for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      } {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      } long A = sc.nextLong(); A sc.nextLong() sc.nextLong sc if(A==0) {
        ans = 0;
        of = false;
        break;
      } A==0 A 0 {
        ans = 0;
        of = false;
        break;
      } ans = 0 ans 0 of = false of false break; long Amax = max/ans; Amax max/ans max ans if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        } A>Amax A Amax {
          of = true;
        } of = true of true {
          ans *= A;
        } ans *= A ans A System.out.println(of? -1 : ans) System.out.println System.out System System.out of? -1 : ans of -1 1 ans sc.close() sc.close sc String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    long max = 1000000000000000000L;
    long ans = 1;
    boolean of = false;
    for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      }
    System.out.println(of? -1 : ans);

    sc.close();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int N = sc.nextInt();
    long max = 1000000000000000000L;
    long ans = 1;
    boolean of = false;
    for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      }
    System.out.println(of? -1 : ans);

    sc.close();
  }
} 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 max = 1000000000000000000L;
    long ans = 1;
    boolean of = false;
    for(int i=0; i<N; i++) {
      long A = sc.nextLong();
      if(A==0) {
        ans = 0;
        of = false;
        break;
      }
        long Amax = max/ans;
        if(A>Amax) {
          of = true;
        } else {
          ans *= A;
        }
      }
    System.out.println(of? -1 : ans);

    sc.close();
  }
}
