#include <stdio.h>
int main(){
    long long unsigned int n;
    int flag=0;
    long long unsigned int e=1;
    scanf("%lld",&n);
    long long unsigned int tmp=0;
    for(long long unsigned int i=0;i<n;i++){
        tmp=0;
        scanf("%lld",&tmp);
        e=e*tmp;
        if(e>1000000000000000000)flag++;
    }
    if(flag==0)printf("%lld",e);
    else printf("-1");
    return 0;
}