#include <stdio.h>
int main(void){
  long N,K = 1;
  int i = 0;
  scanf("%ld",&N);
  long A[N];
  while(i < N){
    scanf("%ld",&A[i]);
    K = K * A[i];
    if(K > 1000000000000000000){
      printf('-1');
      break;
    }
    i += 1;
  }
  if(i == N){
    printf("%ld",K);
  }
  return 0;
}