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

return 0;

}
