import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
public class Main{
  public static void main(String agrs[])
  {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = in.nextInt();
    long[] arr = new long[n];
    long max = (long) Math.pow(10,18);
    boolean zero = false;
    long counter = 1;
    for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    }
    if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    }
    out.close();
  }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.math.*; math.* java import java.io.*; io.* java public class Main{
  public static void main(String agrs[])
  {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = in.nextInt();
    long[] arr = new long[n];
    long max = (long) Math.pow(10,18);
    boolean zero = false;
    long counter = 1;
    for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    }
    if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    }
    out.close();
  }
} Main public static void main(String agrs[])
  {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = in.nextInt();
    long[] arr = new long[n];
    long max = (long) Math.pow(10,18);
    boolean zero = false;
    long counter = 1;
    for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    }
    if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    }
    out.close();
  } main {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = in.nextInt();
    long[] arr = new long[n];
    long max = (long) Math.pow(10,18);
    boolean zero = false;
    long counter = 1;
    for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    }
    if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    }
    out.close();
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int n = in.nextInt(); n in.nextInt() in.nextInt in long[] arr = new long[n]; arr new long[n] n long max = (long) Math.pow(10,18); max (long) Math.pow(10,18) Math.pow Math 10 18 boolean zero = false; zero false long counter = 1; counter 1 for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    } {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    } arr[i] = in.nextLong() arr[i] arr i in.nextLong() in.nextLong in if(arr[i] == 0)
      {
        zero = true;
      } arr[i] == 0 arr[i] arr i 0 {
        zero = true;
      } zero = true zero true if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    } zero {
      out.println(0);
    } out.println(0) out.println out 0 {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    } for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      } {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      } if(arr[i] > max / counter)
        {
          zero = true;
          break;
        } arr[i] > max / counter arr[i] arr i max / counter max counter {
          zero = true;
          break;
        } zero = true zero true break; counter *= arr[i] counter arr[i] arr i if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      } zero {
        out.println(-1);
      } out.println(-1) out.println out -1 1 {
        out.println(counter);
      } out.println(counter) out.println out counter out.close() out.close out String agrs[] agrs public class Main{
  public static void main(String agrs[])
  {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = in.nextInt();
    long[] arr = new long[n];
    long max = (long) Math.pow(10,18);
    boolean zero = false;
    long counter = 1;
    for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    }
    if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    }
    out.close();
  }
} public class Main{
  public static void main(String agrs[])
  {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = in.nextInt();
    long[] arr = new long[n];
    long max = (long) Math.pow(10,18);
    boolean zero = false;
    long counter = 1;
    for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    }
    if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    }
    out.close();
  }
} Main
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
public class Main{
  public static void main(String agrs[])
  {
    Scanner in = new Scanner(System.in);
    PrintWriter out = new PrintWriter(System.out);
    int n = in.nextInt();
    long[] arr = new long[n];
    long max = (long) Math.pow(10,18);
    boolean zero = false;
    long counter = 1;
    for(int i = 0; i < n; i++)
    {
      arr[i] = in.nextLong();
      if(arr[i] == 0)
      {
        zero = true;
      }
    }
    if(zero)
    {
      out.println(0);
    }
    else
    {
      for(int i = 0; i < n; i++)
      {
        if(arr[i] > max / counter)
        {
          zero = true;
          break;
        }
        counter *= arr[i];
      }
      if(zero)
      {
        out.println(-1);
      }
      else
      {
        out.println(counter);
      }
    }
    out.close();
  }
}