#include <stdio.h>
 
#define MAX 1000000000000000000
#define N 100000

int main(void)
{
  int n, i = 0;
  long long tmp, r = 1;
  
  scanf("%d", &n);
  i = 0;
  while(i < n)
  {
    scanf("%lld", &tmp);
    if(tmp == 0)
    {
      printf("0");
      return 0;
    }
    if(MAX / r < tmp)
    {
      r = -1;
    }
    if(r > 0) r *= tmp;
    i++;
  }
  printf("%lld", r);
  return 0;
}