#include<stdio.h>
#include<math.h>
int main()
{
    unsigned long long int t,n[100000],mul=1;
    scanf("%lld",&t);
    for(int i=0;i<t;i++){
        scanf("%lld",&n[i]);
    }
    for(int j=0;j<t;j++){
        if(n[j]==0){
            printf("0");
            break;
        }else if(j==t-1){
        mul=mul*n[j];
        if(mul>1000000000000000000)printf("-1");
        else printf("%lld",mul);
        }else{
        mul=mul*n[j];
        }
    }

    return 0;

}
