#include<stdio.h>
#include<math.h>
int main ()
{
    int n;
    scanf("%d",&n);

    long long int i,ar[n];
    for(i = 0;i<n;i++)
    {
        scanf("%lld",&ar[i]);
    }
    long long int product = 1 ;
    for(i = 0;i<n;i++)

    {


      product *= ar[i];
    }
      if(product>= 0 && product <= (1000000000000000000))
      {

       printf("%lld\n",product);
      }
      else if(product>= 0 && product > (1000000000000000000))
      {

          printf("%lld\n",product = -1);
      }





    return 0;
}
