import java.io.InputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger border = BigInteger.valueOf(10).pow(18);
    long a[] = new long[n];
    for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    }
    BigInteger ans = BigInteger.valueOf(1);
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    }
    pw.println(ans);
  }
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.math.BigInteger; BigInteger java.math import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger border = BigInteger.valueOf(10).pow(18);
    long a[] = new long[n];
    for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    }
    BigInteger ans = BigInteger.valueOf(1);
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    }
    pw.println(ans);
  }
} Main public static void main(String[] args) {
    resolve(System.in, System.out);
  } main {
    resolve(System.in, System.out);
  } resolve(System.in, System.out) resolve System.in System System.in System.out System System.out String[] args args static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger border = BigInteger.valueOf(10).pow(18);
    long a[] = new long[n];
    for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    }
    BigInteger ans = BigInteger.valueOf(1);
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    }
    pw.println(ans);
  } resolve {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger border = BigInteger.valueOf(10).pow(18);
    long a[] = new long[n];
    for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    }
    BigInteger ans = BigInteger.valueOf(1);
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    }
    pw.println(ans);
  } Scanner sc = new Scanner(is); sc new Scanner(is) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc BigInteger border = BigInteger.valueOf(10).pow(18); border BigInteger.valueOf(10).pow(18) BigInteger.valueOf(10).pow BigInteger.valueOf(10) BigInteger.valueOf BigInteger 10 18 long a[] = new long[n]; a new long[n] n for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    } {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    } a[i] = Long.parseLong(sc.next()) a[i] a i Long.parseLong(sc.next()) Long.parseLong Long sc.next() sc.next sc if (a[i] == 0) {
        pw.println(0);
        return;
      } a[i] == 0 a[i] a i 0 {
        pw.println(0);
        return;
      } pw.println(0) pw.println pw 0 return; BigInteger ans = BigInteger.valueOf(1); ans BigInteger.valueOf(1) BigInteger.valueOf BigInteger 1 for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    } {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    } ans = ans.multiply(BigInteger.valueOf(a[i])) ans ans.multiply(BigInteger.valueOf(a[i])) ans.multiply ans BigInteger.valueOf(a[i]) BigInteger.valueOf BigInteger a[i] a i if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      } ans.compareTo(border) > 0 ans.compareTo(border) ans.compareTo ans border 0 {
        pw.println(-1);
        return;
      } pw.println(-1) pw.println pw -1 1 return; pw.println(ans) pw.println pw ans InputStream is is PrintStream pw pw public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger border = BigInteger.valueOf(10).pow(18);
    long a[] = new long[n];
    for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    }
    BigInteger ans = BigInteger.valueOf(1);
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    }
    pw.println(ans);
  }
} public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger border = BigInteger.valueOf(10).pow(18);
    long a[] = new long[n];
    for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    }
    BigInteger ans = BigInteger.valueOf(1);
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    }
    pw.println(ans);
  }
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    resolve(System.in, System.out);
  }

  static void resolve(InputStream is, PrintStream pw) {
    Scanner sc = new Scanner(is);
    int n = Integer.parseInt(sc.next());
    BigInteger border = BigInteger.valueOf(10).pow(18);
    long a[] = new long[n];
    for (int i = 0; i < n; i++) {
      a[i] = Long.parseLong(sc.next());
      if (a[i] == 0) {
        pw.println(0);
        return;
      }
    }
    BigInteger ans = BigInteger.valueOf(1);
    for (int i = 0; i < n; i++) {
      ans = ans.multiply(BigInteger.valueOf(a[i]));
      if (ans.compareTo(border) > 0) {
        pw.println(-1);
        return;
      }
    }
    pw.println(ans);
  }
}
