Black and yellow do not have to have to be connected. They shouldn't be considered as ground. If you rely on them being ground, you'll be screwed if there is a second phone line, if they aren't connected to ground, and if the wiring only has red and green.