#include <stdio.h>

int main(void){

int n;
scanf("%d",&n);
int ans=1;
int a[200000];

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

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

        ans*=a[i];
}

if(ans>1000000000000000000 || ans<0){
        printf("-1\n");
}else{
        printf("%d\n",ans);
}

return 0;
}
