LeSean McCoy Buffalo Bills
LeSean McCoy #25 of the Buffalo Bills scores a touchdown during the second half of the NFL game against the Los Angeles Chargers at StubHub Center on Nov. 19, 2017 in Carson, California. Jeff Gross/Getty Images

The Buffalo Bills own the NFL’s longest playoff drought. Yes, even the Cleveland Browns have been in the postseason more recently than the team from Western New York.

Buffalo has a chance to change all of that in Week 17 as they hover near the 2017 NFL playoff picture. Even though the Bills enter their upcoming game against the Miami Dolphins currently out of the postseason, a victory and some help around the league can earn Buffalo a wild-card berth because of tiebreaker scenarios.

The New England Patriots are the AFC East champions, leaving the Bills fighting for either the conference’s No.5 or No.6 seed. There are a few paths for Buffalo to clinch a wild-card spot, but they all begin with a win Sunday. If Buffalo can’t win in Miami, they aren’t going to the playoffs.

Playing against a Dolphins’ team that’s out of contention, the Bills should be able to take care of business in Week 17. They are three-point favorites in Miami, per OddsShark. The Bills defeated the Dolphins 24-16 just two weeks ago, intercepting Jay Cutler three times.

Three other teams are looking to clinch a playoff berth. The Baltimore Ravens enter Week 17 as the No.5 seed and the Tennessee Titans own the No.6 seed. Neither team has secured a postseason spot, and both would likely miss the playoffs with a loss Sunday.

The Los Angeles Chargers are also lurking as the current No.7 seed.

The first scenario that gets the Bills into the playoffs is a Buffalo win coupled with a Baltimore loss. If those two things happen, it won’t matter what Los Angeles or Tennessee does.

If the Bills win and the Ravens win, Buffalo’s playoff chances take a major hit. In that scenario, the Bills would need both L.A. and Tennessee to either lose or tie.

In the unlikely scenario that the Bills tie the Dolphins, Buffalo would need both the Chargers and Titans to lose in order to reach the playoffs.

Unfortunately for Buffalo, the three other potential wild-card teams are all favored.

Baltimore hosts the Cincinnati Bengals, who have long been eliminated from the playoffs. Tennessee hosts the Jacksonville Jaguars, who have already clinched the AFC South title and have nothing on the line. Los Angeles is a seven-point favorite at home against the Oakland Raiders.

Winning on Sunday would put the Bills at 9-7, matching their best record during their playoff drought. Buffalo went 11-5 in the 1999 season when they last reached the playoffs.

New England will be largely to blame if the Bills miss the playoffs for yet another season. Buffalo’s only losses in the last five weeks came at the hands of the Patriots.

Buffalo lost 52-24 to Los Angeles in Week 11 when Tyrod Taylor was benched for Nathan Peterman, giving the Chargers the head-to-head tiebreaker over the Bills. Tennessee owns the tiebreaker over Buffalo because of their superior conference record.