#include<stdio.h>

int main(){
  
  int i;
  int n;
  long long a;
  long long ans = 1;
  
  scanf("%d",&n);
  
  for(i = 0; i < n; i++){
    scanf("%lld",&a);
    ans *= a;
    printf("a = %lld ans = %lld\n",a ,ans);
    
  }
    if(ans > 1000000000000000000){
    printf("-1\n");
    }else{
    printf("%lld\n",ans);
    }
  return 0;
        
}