No, yachts cannot sail directly into the wind.
When a yacht tries to sail directly into the wind, the sails will lose their ability to generate lift, causing them to flap (or luff), and the boat will lose forward momentum.
Instead, yachts sail at an angle to the wind, typically between 30 and 45 degrees, a technique called "sailing close-hauled." This allows them to make progress upwind by sailing in a zigzag pattern called tacking, where the boat alternates directions to gradually move against the wind.