import java.util.*;
public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    long[] b = new long[a];
    long MAX = (long)Math.pow(10,18);
    long result = 1;
    
    
    for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    }
    
    
    for(int i = 0; i < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    }
    System.out.println(result);
  }
} import java.util.*; util.* java public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    long[] b = new long[a];
    long MAX = (long)Math.pow(10,18);
    long result = 1;
    
    
    for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    }
    
    
    for(int i = 0; i < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    }
    System.out.println(result);
  }
} Main public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    long[] b = new long[a];
    long MAX = (long)Math.pow(10,18);
    long result = 1;
    
    
    for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    }
    
    
    for(int i = 0; i < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    }
    System.out.println(result);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    long[] b = new long[a];
    long MAX = (long)Math.pow(10,18);
    long result = 1;
    
    
    for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    }
    
    
    for(int i = 0; i < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    }
    System.out.println(result);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc long[] b = new long[a]; b new long[a] a long MAX = (long)Math.pow(10,18); MAX (long)Math.pow(10,18) Math.pow Math 10 18 long result = 1; result 1 for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    } int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    } {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    } b[i] = sc.nextLong() b[i] b i sc.nextLong() sc.nextLong sc if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      } b[i]  == 0 b[i] b 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 < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    } int i = 0; int i = 0; i 0 i < a i a i++ i++ i {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    } {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    } if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      } MAX/result < b[i] MAX/result MAX result b[i] b i {
        System.out.println(-1);
        return;
      } System.out.println(-1) System.out.println System.out System System.out -1 1 return; {
        result *= b[i];
      } result *= b[i] result b[i] b i System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    long[] b = new long[a];
    long MAX = (long)Math.pow(10,18);
    long result = 1;
    
    
    for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    }
    
    
    for(int i = 0; i < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    }
    System.out.println(result);
  }
} public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    long[] b = new long[a];
    long MAX = (long)Math.pow(10,18);
    long result = 1;
    
    
    for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    }
    
    
    for(int i = 0; i < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    }
    System.out.println(result);
  }
} Main
import java.util.*;
public class Main
{
  public static void main(String[] args)
  {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    long[] b = new long[a];
    long MAX = (long)Math.pow(10,18);
    long result = 1;
    
    
    for(int i = 0; i < a; i++)
    {
      b[i] = sc.nextLong();
      if(b[i]  == 0)
      {
        System.out.println(0);
      	return;
      }
    }
    
    
    for(int i = 0; i < a; i++)
    {
      if(MAX/result < b[i])
      {
        System.out.println(-1);
        return;
      }
      else
      {
        result *= b[i];
      }
    }
    System.out.println(result);
  }
}
