Below is the link to an article about constipation in this angelic breed.
Yorkie Constipation | Yorkshire Terrier Information Center
I'm not a vet and haven't seen the dog, but I did have a vet express the glands of my late little Katy girl a few times in the last year of her life. Katy never had impacted glands but she did swing between periods of mushy-pooh-pooh and borderline constipation a couple of times.
At the suggestion of Katy's vet, we did add pumpkin* to her diet. This is also a recommendation in the linked article.
Hope this helps.
*NOT pie filling! Use just plain, unsweetened canned pumpkin.