#include <stdio.h>

int main(){
  unsigned int N;

  unsigned int i;
  double ans = 1;
  
  scanf("%ud",&N);
  double A[N+1];
  for(i=0;i<N;i++){
    scanf("%lf",&A[i]);
    ans *= A[i];
    if(A[i] == 0) break;
  }
  if(ans > 1000000000000000000 || ans < 0) ans = -1;
  printf("%.0f\n",ans);
  
  return 0;
}