#include<stdio.h>
int main (void){
  int n,i,j,k;
  long long a[100000],ans;
  ans=1;
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    scanf("%lld",&a[i]);
    if(a[i]==0){ans=0;}
  }

  
  for(i=0;i<n;i++){
    if(ans>ans*a[i]||ans*i>1000000000000000000){ans=-1;break;}
    
    ans=ans*a[i];
  }
  
  printf("%lld",ans);
  return 0;
}