WASHINGTON — Mets fans worried about whether Yoenis Cespedes is going to be with the team again next season should thank Nationals leftfielder Jayson Werth for playing well this season and for playing even better in the NLDS against the Dodgers.

Confused? Follow the train:

Last offseason, the Nationals offered Cespedes a five-year, $110-million contract to bolt the Mets. But the money was heavily deferred in part because Washington has a lot of heavy contracts, including Werth’s seven-year, $126-million deal.

Werth was coming off an injury-plagued 2015, but he still had two years left at $21 million per. The Nationals wanted Cespedes. But he didn’t want so much money deferred and re-signed with the Mets for three years and $75 million, with an opt-out that he can exercise after the World Series.

Assuming Cespedes opts out again, Washington might make a renewed bid. Or the Nationals could back off because Werth returned to form and was having a boffo NLDS going into Thursday night’s deciding Game 5 at Nationals Park.

Werth, 37, hit just .244 this year but had 21 home runs and 69 RBIs. He crushed lefthanded pitchers, batting .322 with a 1.031 OPS, which made him super-valuable hitting in front of or between lefty-swinging Bryce Harper and Daniel Murphy in the heart of Dusty Baker’s order.

advertisement | advertise on newsday

“I’m trying to have good at-bats,” Werth said. “Ever since Dusty moved me into the two-hole, I just felt like my job is to get on base for the animals behind me. I’m just focused on getting on base and scoring runs and having good at-bats and making the pitcher work. That’s pretty much been my game my whole career, even before I started playing professionally. Just trying to be me.”

On Thursday night, Baker put Werth between Harper and Murphy in the three-hole against lefthander Rich Hill. In the first four games, Werth was 7-for-15 (.467) with a homer and three RBIs.

“It’s like a young car vs. a new car vs. an old car,” Baker said. “A young car you just start and take off, but the old car, you’ve got to let it warm up and shoot some carbon out and get warm, right? But when that old car starts purring, then it can go as good as the young car.”

Baker, in his first year as Nationals manager, said one of his priorities when he took over was to get Werth back to where he was before injuries limited him to 88 games in 2015.

“I wasn’t worried,” Baker said. “You get worried if a guy gains a bunch of weight or if a guy loses desire, which some players do. Or they either get tired of pain over the course of time. And I didn’t get any of those impressions from him. Mostly, his legs are still good. I’ve seen some of the greatest players of all time, when their legs go, they go. And so Jayson still has good legs. He eats as nutritious as anybody on the team. I mean, he’s gluten-free, everything. Raises his own vegetables and stuff like that. So Jayson Werth, I wasn’t real worried about him, because he has a desire to play even after this contract, which I think he can.”

@NewsdaySports

Said Werth: “I think after last year, with the injuries and the way it ended, I felt like it was just like an opportunity lost. I feel like it got taken away last year, and obviously I can’t play this game forever. So I feel like this is our chance and I also feel like maybe this is my last chance to do it. For whatever reason, just been having fun.”