Some sources list Hot Springs in Arkansas as the first national park. Set aside in 1832, forty years before Yellowstone was established in 1872, it was actually the nation’s oldest national reservation, set aside to preserve and distribute a utilitarian resource (hot water), much like our present national forests. In 1921, an act of Congress established Hot Springs as a national park.
Yosemite became a park before Yellowstone, but as a state park. Disappointed with the results 26 years later in 1890, Congress made Yosemite one of three additional national parks, along with Sequoia and General Grant, now part of Kings Canyon. Mount Rainier followed in 1899.
As an older state park, Yosemite did have a strong influence on the founding of Yellowstone in 1872 because Congress actually used language in the state park act as a model. It’s entirely possible that Congress may have preferred to make Yellowstone a state park in the same fashion as Yosemite, had it not been for an accident of geography that put it within three territorial boundaries. Arguments between Wyoming and Montana territories that year resulted in a decision to federalize Yellowstone.