import java.util.*;

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

    int n = sc.nextInt();
    long[] a = new long[n];
    long ans = 1;
    long max = (long)Math.pow(10, 18);

    for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    }

    for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        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);

    int n = sc.nextInt();
    long[] a = new long[n];
    long ans = 1;
    long max = (long)Math.pow(10, 18);

    for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    }

    for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    }

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

    int n = sc.nextInt();
    long[] a = new long[n];
    long ans = 1;
    long max = (long)Math.pow(10, 18);

    for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    }

    for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    }

    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    long[] a = new long[n];
    long ans = 1;
    long max = (long)Math.pow(10, 18);

    for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    }

    for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    }

    System.out.println(ans);
  } 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 long ans = 1; ans 1 long max = (long)Math.pow(10, 18); max (long)Math.pow(10, 18) Math.pow Math 10 18 for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    } {
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      } a[i] == 0 a[i] a i 0 {
        System.out.println(0);
        System.exit(0);
      } System.out.println(0) System.out.println System.out System System.out 0 System.exit(0) System.exit System 0 for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    } {
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    } if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      } a[i] <= max / ans a[i] a i max / ans max ans {
        ans *= a[i];
      } ans *= a[i] ans a[i] a i {
        ans = -1;
        break;
      } ans = -1 ans -1 1 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);

    int n = sc.nextInt();
    long[] a = new long[n];
    long ans = 1;
    long max = (long)Math.pow(10, 18);

    for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    }

    for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    }

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

    int n = sc.nextInt();
    long[] a = new long[n];
    long ans = 1;
    long max = (long)Math.pow(10, 18);

    for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    }

    for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    }

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

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

    int n = sc.nextInt();
    long[] a = new long[n];
    long ans = 1;
    long max = (long)Math.pow(10, 18);

    for(int i = 0; i < n; i++){
      a[i] = sc.nextLong();
      
      if(a[i] == 0){
        System.out.println(0);
        System.exit(0);
      }
    }

    for(int i = 0; i < n; i++){
      if(a[i] <= max / ans){
        ans *= a[i];
      } else {
        ans = -1;
        break;
      }
    }

    System.out.println(ans);
  }
}
