#include <stdio.h>
#include <math.h>

int main(void){
  int n, i;
  unsigned long value[100000], result = 1;

  scanf("%d",&n);

  for( i = 0 ; i < n ; i++ )
    scanf("%lu",&value[i]);

  for( i = 0 ; i < n ; i++ )
    result *= value[i];

  if( ( result > pow( 10.0, 18.0 ) ) || ( result < 0 ) )
    printf("-1\n");
  else
    printf("%lu\n",result);

  return 0;
}
