#include<stdio.h>
int main(void)
{
  int a,b,c=1,d,e,n,i;
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%d",&b);
    c=b*c;    
  }
  if(c>1000000000000000000){
    printf("%d",-1);
  }else{
    printf("%d",c);
  }
  
  return 0;
}