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

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