#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#define min(x, y) (x < y ? x : y)
#define ll long long int 

int main()
{

  ll N ;
  scanf("%lld",&N);

  ll A[N];
  ll sum = 1 ;
  ll test = 1e+18;
  
  for (ll i = 0; i<N;i++)
  {
   scanf("%lld",&A[i]);
    sum*=A[i];
  }  
    if (sum>test)
    {
     printf("-1");
     return 0;
    }
  

  printf("%lld",sum);



  return 0;
}
