#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
int main(){
  uint_fast16_t n;
  uint_fast64_t c,s=0;
  scanf("%" SCNuFAST16 "",&n);
  for(uint_fast16_t i=0;i<n;i++){
    scanf("%" SCNuFAST64 "",&c);
    if(c==0)puts("0"),exit(0);
    s*=c;
  }
  if(s>1000000000000000000)puts("-1");
  else printf("%" PRIuFAST64 "\n",s);
}