#include<stdio.h>
int main(){
  long int n,a,b=1,i,f=0,g=1;
  scanf("%ld",&n);
  for(i=0;i<n;i++){
    scanf("%ld",&a);
    if(a==0)g=0;
    else if(b>(long int)1000000000000000000/a)f=-1;
    b*=a;
  }
  if(f)printf("%ld",f*g);else printf("%ld",b);
}
