Not always. Actually YN represents several different words, each of which has a different effect on the word that follows.
1. YN meaning "in", used only with definite nouns, causes nasal mutation:
yn Nolgellau = in Dolgellau
yn Nhal-y-bont = in Tal-y-bont
ym Mangor = in Bangor
ym Mhwllheli = in Pwllheli
yng Ngwynedd = in Gwynedd
yng Nghonwy = in Conwy
2. YN as the particle used to link the verb BOD with a verbnoun, causes no mutation:
Dw i'n mynd = I am going
Mae'r gath yn bwyta = The cat is eating
Roedd y bachgen yn darllen = The boy was reading
Bydd fy mam yn garddio = My mother will be gardening
3. YN as a particle used to link the verb BOD with a noun or adjective, and to form adverbs from adjectives, causes soft mutation; however, it does not mutate words beginning with LL or RH:
Mae dy wyneb yn frwnt (< brwnt) = Your face is dirty
Mae'r cinio'n barod (< parod) = The dinner is ready
Mae'r tywydd yn arw (< garw) = The weather is rough
Roedd ei feibion yn ganwyr (< canwyr) = His sons were singers
Dw i wedi cysgu'n dda (< da) = I have slept well
Mae'r ferch honno yn dal (< tal) = That girl is tall
Mae'r mêl yn felys (< melys) = Honey is sweet
BUT: Mae'r botel yn llawn = The bottle is full
Roedd yr anrheg yn rhad = The present was cheap