#include<stdio.h>
#include<limits.h>
int main(void){
  int N, i;
  scanf("%d",&N);
  long long int c[N],k=1;
  for(i=0;i<N;i++){
    scanf("%lld",&c[i]);
  }
  for(i=0;i<N;i++){
    k = k*c[i];
  }
  if(k>1000000000000000000)
    printf("-1");
  else
    printf("%lld",k);
  return 0;
}
