#include <stdio.h>
int main(void){
    // Your code here!
    long n,a,j=1;
    scanf("%ld",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a);
        j=a*j;
        
    }
    if(j>1000000000000000000)printf("-1\n");
    else printf("%ld\n",j);
    return 0;
}
