#include<stdio.h>
#include<math.h>
int main()
{
    long long n,i,res = 1;
    scanf("%lld",&n);

    long long ara[n];
    for(i=0;i<n;i++){
        scanf("%lld",&ara[i]);
        res*=ara[i];
    }

    if(res<0||res>1000000000000000000) printf("-1\n");
    else printf("%lld\n",res);
}
