import java.util.*;

public class Main {
  private static final long MAX = (long)1e18;
  
  public static void main(String args[]) {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  }
} import java.util.*; util.* java public class Main {
  private static final long MAX = (long)1e18;
  
  public static void main(String args[]) {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  }
} Main private static final long MAX = (long)1e18; MAX (long)1e18 public static void main(String args[]) {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  } main {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  } long multiplication = 1; multiplication 1 Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    } {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    } long num = in.nextLong(); num in.nextLong() in.nextLong in if (num == 0) {
        System.out.print(0);
        return;
      } num == 0 num 0 {
        System.out.print(0);
        return;
      } System.out.print(0) System.out.print System.out System System.out 0 return; if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      } multiplication != -1 multiplication -1 1 {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      } if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        } num > MAX / multiplication num MAX / multiplication MAX multiplication {
          multiplication = -1;
        } multiplication = -1 multiplication -1 1 {        
          multiplication *= num;
        } multiplication *= num multiplication num System.out.print(multiplication) System.out.print System.out System System.out multiplication String args[] args public class Main {
  private static final long MAX = (long)1e18;
  
  public static void main(String args[]) {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  }
} public class Main {
  private static final long MAX = (long)1e18;
  
  public static void main(String args[]) {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  }
} Main
import java.util.*;

public class Main {
  private static final long MAX = (long)1e18;
  
  public static void main(String args[]) {
  	long multiplication = 1;
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    
    for (int i=0; i<n; i++) {
      long num = in.nextLong();
      if (num == 0) {
        System.out.print(0);
        return;
      } 
      
      if (multiplication != -1) {
        if (num > MAX / multiplication) {
          multiplication = -1;
        } else {        
          multiplication *= num;
        }
      }
    }
    
    System.out.print(multiplication);
  }
}
