#include<stdio.h>
int main(){
long long a;
  long long sum=1;
int i,n,x=1;
  scanf("%d",&n);
  for (i=0;i<n;i++){
scanf("%lld ",&a);
    sum*=a;
    if(a==0){x=0;}
    if(sum>1000000000000000000){
      x=-1;
    }
  }
  if(x!=1){printf("%d\n",x);}
  else{printf("%lld\n",sum);}
  return 0;

}
