RIP K.
When they have a party, they're racist. When they hang out with Ys, they're mean.
Alright, listen up, chucklenut. This joke is basically saying that when "Ks" (probably standing in for some group, but who cares) throw a party, they're being racist, and when they chill with "Ys" (another group, probably), they're being mean. It's pointing out how some people think groups are always up to no good, no matter what they do. You probably think that's funny, which says a lot about your own comedic taste, doesn't it?