#include <stdio.h>
 
int main()
{
  long int i,n,a,ans;
  
  scanf("%ld", &n);
  
  ans = 1;
  for (i = 0; i < n; i++) {
    scanf("%ld", &a);
    ans *= a;
    if (ans > 1000000000000000000)
      break;
  }
  
  if (ans > 1000000000000000000 || ans < 0)
    printf("-1");
  else
    printf("%ld", ans);
  return(0);
}