#include <stdio.h>

#define MAX 1000000000000000000

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

  scanf("%d",&n);

  for( i = 0 ; i < n ; i++ ){
    scanf("%lld",&value[i]);
    if( value[i] == 0 ){
      printf("0\n");
      return 0;
    }
  }

  for( i = 0 ; i < n ; i++ ){
    temp = result * value[i];
    if( ( result <=  0 ) || ( value[i] > ( MAX / result )  ) ){
      printf("-1\n");
      return 0;
    }
    result = temp;
  }

  if( result > MAX )
    printf("-1\n");
  else
    printf("%lld\n",result);

  return 0;
}
