When still nun or tanwin precedes any of ي، ر، م، ل، و، ن, assimilation occurs under the relevant conditions. The six letters are memorized in «يَرْمَلُونَ». Assimilation joins the original n sound into the next consonant rather than pronouncing it as an independent stop.
Four letters ي، ن، م، و: idgham with ghunnah; the nasal resonance remains.
Two letters ل، ر: idgham without ghunnah; no separate nasal resonance of nun is retained.
The standard rule operates across a word boundary, including the sound of tanwin joining the next word. Within a single word, an example such as «دُنْيَا» requires a special clear pronunciation instead.