#include<stdio.h>
signed main(){
  long long N,A[100000],res=1;
  scanf("%lld",&N);
  int i;
  for(i=0;i<N;i++){
    scanf("%lld",&A[i]);
  }
  for(i=0;i<N;i++){
    res*=A[i];
  }
  if(res>1000000000000000000){
    printf("-1\n");
  }else{
    printf("%lld\n",res);
  }
  return(0);
}