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