If the Empire had destroyed Yavin to get a line of fire on Yavin 4. The death star wouldn't have had enough energy to charge another shot to destroy the planet. So if they had destroyed Yavin, the rebels would have had a hell of a lot more time to destroy the Death Star.