#include<stdio.h>
int main()
{
  unsigned long A[200000],sum=1;
  int x,i;
  scanf("%d",&x);
  for(i=0;i<x;i++)
  {
    scanf("%lu",&A[i]);
    sum=sum*A[i];
  }
  if(sum>1000000000000000000)
    printf("-1");
  else
    printf("%lu",sum);
}