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

return 0;

}
