Spotting or yeast infection

Is yellow discharge before a period considered spotting or a yeast infection? Pls help