If you go in the summer it will be crowded in the popular spots and on some (if not most) of the roads. (Remember there are only 2 seasons in YNP. (Winter and Road Construction
) Depending on what you like to do you can still get away from the crowds. We like to view and photograph wildlife so we end up in some of the more less traveled areas. Cooke City is a great place to stay if this is what you like to do.
I've been to both places. It's a close decision but YNP comes out on top for me. Yosemite Valley is perhaps the most beautiful spot on earth but on a summer weekend day it's one of the most crowded spots as well. Of course there is much more to Yosemite than just the Valley but that is where most want to go and see all the famous spots / sights.
For me it just comes to the overall experience and that is why I'd choose YNP. It has the majestic falls and mountains like Yosemite. (They're just aren't all concentrated in one spot like Yosemite) YPN also has the geysers which are really good to see. (especially for kids) It also has the wildlife that earns it the America's Serengeti title.
If you like to hike both places has that, but Yosemite also has rock climbing / hiking. (Hiking up to the top of Half Dome is spectacular)
You'll really enjoy visiting either place.