#include <stdio.h>
 
#define MAX 1000000000000000000

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