#include <stdio.h>
#include <limits.h>
int main(void)
{
  unsigned long long int a[100000],total=1;
  int i,n;
  if( scanf("%d", &n) == 1);
  for(i=0;i<n;i++)
  {
    if( scanf("%lld", &a[i]) == 1);
  }
  for(i=0;i<n;i++)
  {
    total *= a[i];
  }
  if(total > 1000000000000000000)
  {
    total = -1;
  }
  printf("%lld",total);
 
  return 0;
}