#include<stdio.h>
int main(void)
{
  unsigned long n;
  unsigned long  sum=1UL;
  scanf("%ld",&n);
  unsigned long  a[n];
  for(unsigned long i=0;i<n;i++){
    scanf("%ld",&a[i]);
  }

  for(unsigned long i=0;i<n;i++){
    sum=sum*a[i];
  }
  if(sum>1000000000000000000UL){
    sum=-1UL;
  }
  printf("%ld\n",sum);
  return 0;
}
