#include<stdio.h>
#include<stdlib.h>
int main(void){
int N;
scanf("%d",&N);
unsigned long long m=1,A[N+1];
  for(int i=0;i<N;i++){
  scanf("%ld",&A[i]);
  m=m*A[i];
  if(m>1000000000000000000||m<0) break;
  }
if(m>1000000000000000000||m<0) printf("-1");
else printf("%ld",m);
return 0;
}



