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

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

  }
  return 0;
}
