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