import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long ans = 1;
    int n = sc.nextInt();

    for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    }

    System.out.println(ans);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long ans = 1;
    int n = sc.nextInt();

    for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    }

    System.out.println(ans);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long ans = 1;
    int n = sc.nextInt();

    for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    }

    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    long ans = 1;
    int n = sc.nextInt();

    for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    }

    System.out.println(ans);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long ans = 1; ans 1 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    } {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    } long next = sc.nextLong(); next sc.nextLong() sc.nextLong sc if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      } ans != -1 ans -1 1 {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        } 1000000000000000000L / next < ans 1000000000000000000L / next 1000000000000000000L next ans {
          ans = -1;
        } ans = -1 ans -1 1 {
          ans *= next;
        } ans *= next ans next {
        if (next == 0) {
          ans = 0;
          break;
        }
      } if (next == 0) {
          ans = 0;
          break;
        } next == 0 next 0 {
          ans = 0;
          break;
        } ans = 0 ans 0 break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long ans = 1;
    int n = sc.nextInt();

    for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    }

    System.out.println(ans);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long ans = 1;
    int n = sc.nextInt();

    for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    }

    System.out.println(ans);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long ans = 1;
    int n = sc.nextInt();

    for (int i = 0; i < n; i++) {
      long next = sc.nextLong();

      if (ans != -1) {
        if (1000000000000000000L / next < ans) {
          ans = -1;
        } else {
          ans *= next;
        }
      } else {
        if (next == 0) {
          ans = 0;
          break;
        }
      }
    }

    System.out.println(ans);
  }
}
