#include <stdio.h>


int main(void){
unsigned long n;
scanf("%ld",&n);
unsigned long int ans=1;
unsigned long int a[200000];
int flag=0;

for(int i=0;i<n;i++){
        scanf("%ld",&a[i]);

        if(a[i]==0){
                ans=0;
        }   
        ans*=a[i];

}

if(1000000000000000000>=ans && ans>=0){
        printf("%ld",ans);
}else{
        printf("-1");
}
return 0;
}
