The line between comedy and drama can often be a hard one for television shows to navigate. As they get older, many sitcoms, having already mined tons of material from humorous events, turn to more serious issues and problems, only invoking humor every once in a while. It is an awkward switch for comedies to make and not always a successful one.

Happily, CBS’s brilliant How I Met Your Mother will never have to contend with this problem. From the very beginning, this show has blended humor and heart seamlessly, and the upcoming finale for the show’s second season is no different.

The entire season has been moving steadily towards the impending wedding of Lily (Alyson Hannigan) and Marshall (Jason Segel), two of the show’s main (but not narrating) characters and the season finale’s two episodes bring about the culmination of that storyline. Of course, everything does not go smoothly, and it’s from there that How I Met Your Mother is able to mine the vast majority of the humor in these two episodes. Predictably, when there’s funny to be had at a wedding it’s because the entire thing goes horribly, horribly wrong.

The show often delivers out-of-the-blue funny moments, and the season finale is no exception. I do not wish to give away any of the more humorous moments of the episode, but some of the Marshall stuff is hysterical. It was actually necessary for me to pause the DVD after I literally fell to floor laughing.

The secondary plotline in the second of the two episodes deals with the main character, Ted (Josh Radnor) and his girlfriend Robin (Cobie Smulders) and them recounting a tale of a dinner they recently had to Barney (Neil Patrick Harris, in a role deserving of Emmy consideration).

Barney is the outlier in the show. He is the single friend on the prowl, who constantly comes out with insane stories, catchphrases, and ideas. Wisely, though Barney is a jokester and can be an ass, he also has a heart (albeit a hidden one). He’s the guy that’s always there for his friends, even if it is with some crazy idea of what kind of party will make them feel better.

All the events that take place during the two episodes are natural outgrowths, and have been hinted at, throughout this second season. Yet, for it being clear where things were headed, the show deftly handles the trip. There are enough humorous diversions, side stories, and Barney to make it all fun.

Actually, one of the best elements of the show in general, not just this episode, is its memory. The writers have no problem referencing past episodes and jokes. They’re able to do this without hurting the current episode, but it provides an added enjoyment for those who are repeat viewers.

It would make sense for this to be the case, as the entire narrative of the series is told as a flashback as older Ted, voiced by Bob Saget, is telling his children the story of how he met their mother. Thus, despite the fact that Ted is currently dating Robin, the entire audience knows that they will not end up together, just as the entire audience knows that Lily and Marshall do get married (there was a cliffhanger at the end of season one where they broke up).

If you have not yet seen How I Met Your Mother, counter-intuitively the season finale provides a great entrée into the series (and will cause you to laugh hysterically). It’s a well-written episode that really gives you a good look at who the characters are, and what’s going on in their lives. It exhibits a perfect mix of heart and comedy, which is what the series is so good at.

The first episode in the finale airs Monday May 7 at 8:00pm (ET/PT), and the second on May 14 at the same time.