#include <stdio.h>
 
#define MAX 1000000000000000000
 
int main(void)
{
  int n;
  long long tmp, r = 1;
  
  scanf("%d", &n);
  for(int i = 0; i < n; i++)
  {
    scanf("%d", &tmp);
    if(MAX / r < tmp)
    {
      r = -1;
      //while(getchar() != '\n');
      break;
    }
    r *= tmp;
  }
  printf("%d", r);
  return 0;
}