Yes, as Dan said, tape it, or alternatively hook it to the G terminal on the network inside the phone, which is a blank terminal and not connected to anything inside the network. If your modular line cord also has a black wire, it should be taped too.
In instances where the modular line cord has both the black and yellow wires, some have connected both these wires to the G terminal inside the phone. This will work 90% of the time, but still not recommended. The yellow wire is no longer used as a ground wire, but the yellow and black wires in a modular plug are designed to be connected to a second pair. For instance in homes that have a second line. In that case, connecting both the yellow and black wires to the same terminal inside a phone would short out that second line. While most houses don't have a second line, some do. Even if you don't currently have a second line this could be a problem if you ever did add a second line or if you sell the phone to someone who has a second line.
Therefore, just to be safe, I always recommend just taping and letting both the yellow and black wires dangle.