#include<stdio.h>
#include<math.h>
int main(){
long long int i,n,m,mul=1;
scanf("%lld",&n);
for(i=1;i<=n;i++)
{
    scanf("%lld",&m);
    mul=mul*m;
}
if((double)mul>=(double)pow(10,18))
    printf("-1\n");
else
    printf("%lld\n",mul);
return 0;
}
