
     

#include<stdio.h>
int main()
{
  unsigned long int n,i,ant[1000000],s=1;
    scanf("%ld",&n);
 
    for(i=0;i<=n-1;i++){
        scanf("%ld",&ant[i]);
        s=s*ant[i];
    
    }
    if(s>1000000000000000000){
        printf("-1");
        
    }
    else{
    printf("%ld",s);
    }
}
