Here's the Weatherbase information for YNP, gathered over the past 107 years. Temps fall below freezing at night for at least a few days every month of the year, so plan for it. YNP is at 8,000 ft. elevation.
If you choose to stay outside the park, I also recommend Grizzly. FHUs, 2 blocks from the west gate, and grocery and souvenir prices are lower with better selections in town. The crowds entering through the West gate pile up in the afternoons as people arrive, but in the mornings, there's not much of a delay, especially if you already have a National Parks Pass. And you're 12 miles from the Grand Loop, but you aren't driving through a tunnel. I enter in the morning and often don't make it to the grand loop until nearly noon. Not traffic related. "Buffalo Jams", an eagle's nest, fox den, grazing elk, etc.
Finally, between Grizzly and the west gate is the Grizzly and Wolf Discovery Center. There's an entrance fee, but you'll never be closer to Grizzlies and Wolves (or want to). Its a "no kill" non-profit that rescues the animals that get too used to humans and would otherwise be killed. They're relocated to zoos or moved to remote areas in the western US.