import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long max = 1000000000000000000l;
    long now = 1l;
    long[] a = new long[n];
    for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    }
    System.out.println(now);
  }
} 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 max = 1000000000000000000l;
    long now = 1l;
    long[] a = new long[n];
    for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    }
    System.out.println(now);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long max = 1000000000000000000l;
    long now = 1l;
    long[] a = new long[n];
    for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    }
    System.out.println(now);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long max = 1000000000000000000l;
    long now = 1l;
    long[] a = new long[n];
    for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    }
    System.out.println(now);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long max = 1000000000000000000l; max 1000000000000000000l long now = 1l; now 1l long[] a = new long[n]; a new long[n] n for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    } 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);
        return;
      }
    } {
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    } a[i] = sc.nextLong() a[i] a i sc.nextLong() sc.nextLong sc if(a[i] == 0){
        System.out.println(0);
        return;
      } a[i] == 0 a[i] a i 0 {
        System.out.println(0);
        return;
      } System.out.println(0) System.out.println System.out System System.out 0 return; for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    } {
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    } max /= a[i] max a[i] a i if(max == 0){
        System.out.println(-1);
        return;
      } max == 0 max 0 {
        System.out.println(-1);
        return;
      } System.out.println(-1) System.out.println System.out System System.out -1 1 return; now *= a[i] now a[i] a i System.out.println(now) System.out.println System.out System System.out now String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long max = 1000000000000000000l;
    long now = 1l;
    long[] a = new long[n];
    for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    }
    System.out.println(now);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long max = 1000000000000000000l;
    long now = 1l;
    long[] a = new long[n];
    for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    }
    System.out.println(now);
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long max = 1000000000000000000l;
    long now = 1l;
    long[] a = new long[n];
    for(int i = 0;i<n;i++){
      a[i] = sc.nextLong();
      if(a[i] == 0){
        System.out.println(0);
        return;
      }
    }
    for(int i = 0;i<n;i++){
      max /= a[i];
      // if(max % long != 0)koe = true;
      if(max == 0){
        System.out.println(-1);
        return;
      }
      now *= a[i];
    }
    System.out.println(now);
  }
}
