This is coming from your tonsils. you probably need to go see an ear, nose, and throat specialist to determine whether you need your tonsils removed or not. the yellow, smelly pellets are like puss pockets and if you push a little on your tonsils you would probably see some appear. Yeah, i know it's gross but that would prove to you where they are originating from.
Hope this helps.
Yellow and foul smelling means infection and the yellow thing could be due to tonsils that have got infected. It can also be upper respiratory tract infection and post nasal drip that could be causing this bad smell.
Bad breath, also called halitosis, is typically caused by bacteria that grow in your mouth. Short-term bad breath may be associated with tonsillitis, gastroenteritis, acid reflux, diabetic ketoacidosis, or sinus infection. Chronic halitosis may be caused by poor oral hygiene, gingivitis (gum disease), oropharyngeal infections or a dental abscess.
I suggest you to get it examined from an ENT specialist. It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. Treatment can be started only when the diagnosis is confirmed. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.