#include<stdio.h>longlonga[100010];intmain(){intn;scanf("%d",&n);for(inti=0;i<n;i++)scanf("%lld",&a[i]);intzero=0;2
for(inti=0;i<n;i++)if(a[i]==0)zero++;if(zero >0){printf("0\n");return0;}longlongprod=1;for(inti=0;i<n;i++){if(a[i]<=1000000000000000000/prod){prod*=a[i];}else{printf("-1\n");return0;}}printf("%lld\n",prod);}