import java.util.*;
import java.math.*;

class Problem {
  int n;
  long[] a;
  
  public Problem(int n, long[] a) {
    this.n = n;
    this.a = a;
  }

  public void solve() {
    System.out.println(calc());
  }

  public long calc() {
    if (hasAnyZero()) return 0;
    long ans = 1;
    for (int i = 0; i < n; i++) {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    }
    return ans;
  }

  public boolean hasAnyZero() {
    for (int i = 0; i < a.length; i++) if (a[i] == 0) return true;
    return false;
  }
}

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = sc.nextLong();
    Problem p = new Problem(n, a);
    p.solve();
  }
}
 import java.util.*; util.* java import java.math.*; math.* java class Problem {
  int n;
  long[] a;
  
  public Problem(int n, long[] a) {
    this.n = n;
    this.a = a;
  }

  public void solve() {
    System.out.println(calc());
  }

  public long calc() {
    if (hasAnyZero()) return 0;
    long ans = 1;
    for (int i = 0; i < n; i++) {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    }
    return ans;
  }

  public boolean hasAnyZero() {
    for (int i = 0; i < a.length; i++) if (a[i] == 0) return true;
    return false;
  }
} Problem int n; n long[] a; a public Problem(int n, long[] a) {
    this.n = n;
    this.a = a;
  } Problem {
    this.n = n;
    this.a = a;
  } this.n = n this.n this this.n n this.a = a this.a this this.a a int n n long[] a a public void solve() {
    System.out.println(calc());
  } solve {
    System.out.println(calc());
  } System.out.println(calc()) System.out.println System.out System System.out calc() calc public long calc() {
    if (hasAnyZero()) return 0;
    long ans = 1;
    for (int i = 0; i < n; i++) {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    }
    return ans;
  } calc {
    if (hasAnyZero()) return 0;
    long ans = 1;
    for (int i = 0; i < n; i++) {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    }
    return ans;
  } if (hasAnyZero()) return 0; hasAnyZero() hasAnyZero return 0; 0 long ans = 1; ans 1 for (int i = 0; i < n; i++) {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    } {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    } if (1000000000000000000L / ans < a[i]) return -1; 1000000000000000000L / ans < a[i] 1000000000000000000L / ans 1000000000000000000L ans a[i] a i return -1; -1 1 ans *= a[i] ans a[i] a i return ans; ans public boolean hasAnyZero() {
    for (int i = 0; i < a.length; i++) if (a[i] == 0) return true;
    return false;
  } hasAnyZero {
    for (int i = 0; i < a.length; i++) if (a[i] == 0) return true;
    return false;
  } for (int i = 0; i < a.length; i++) if (a[i] == 0) return true; int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i if (a[i] == 0) return true; if (a[i] == 0) return true; a[i] == 0 a[i] a i 0 return true; true return false; false public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = sc.nextLong();
    Problem p = new Problem(n, a);
    p.solve();
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = sc.nextLong();
    Problem p = new Problem(n, a);
    p.solve();
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = sc.nextLong();
    Problem p = new Problem(n, a);
    p.solve();
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++) a[i] = sc.nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = sc.nextLong(); a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc Problem p = new Problem(n, a); p new Problem(n, a) p.solve() p.solve p String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = sc.nextLong();
    Problem p = new Problem(n, a);
    p.solve();
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = sc.nextLong();
    Problem p = new Problem(n, a);
    p.solve();
  }
} Main
import java.util.*;
import java.math.*;

class Problem {
  int n;
  long[] a;
  
  public Problem(int n, long[] a) {
    this.n = n;
    this.a = a;
  }

  public void solve() {
    System.out.println(calc());
  }

  public long calc() {
    if (hasAnyZero()) return 0;
    long ans = 1;
    for (int i = 0; i < n; i++) {
      if (1000000000000000000L / ans < a[i]) return -1;
      ans *= a[i];
    }
    return ans;
  }

  public boolean hasAnyZero() {
    for (int i = 0; i < a.length; i++) if (a[i] == 0) return true;
    return false;
  }
}

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long[] a = new long[n];
    for (int i = 0; i < n; i++) a[i] = sc.nextLong();
    Problem p = new Problem(n, a);
    p.solve();
  }
}

