#include <stdio.h>

int main()
{
  int n,i;
  long a[],ans=1;
  scanf("%d",n);

  for(i=0; i<n; i++){
    scanf("%ld", &a[i]);
    ans *= a[i];
    }

  if(ans > 1000000000000000000)
    printf("-1");
  else
    printf("%ld",ans);
  return 0;
}
