#include<stdio.h>
int main()
{int a;
    long long int b,sum=1;
scanf("%d",&a);
 while(a--)
 {
  scanf("%lld",&b);
    sum=sum*b;

 }
 if(sum>1000000000000000000)
    printf("-1");
 else
 printf("%lld\n",sum);

return 0;
}
