In a lovely overlapping of the civil and Jewish calendars that happens every few years, Martin Luther King Day and Shabbat Shira fall on consecutive weekends this year.

Both of these days are about freedom and justice. Both are about escape from narrowness to openness, about crossing a river to new hope and new life. Both are about courage on both the personal and communal levels.

In the end, both are about song. Both include death and both move toward light.

The Reverend Martin Luther King Jr., whose legacy we celebrated on Monday, was someone whose self-possession and courage is almost impossible to imagine. If he had lived in an earlier time it would be easy to dismiss the stories as hagiography — and certainly we know enough about his life to know that he was no plaster saint — but the pictures of the pictures of the burly men and their terrifying dogs, the firehoses, the blown-up churches, the bereaved parents of little murdered girls show that the dangers he and everyone else who battled for civil rights faced were real and terrible.

The recordings of his speeches can bring a listener to tears, with their clear and powerful words — and with our knowledge of what was to come next.

We know that many Jews worked together with African Americans on the struggle for civil rights. There were many sociological and historical reasons for that joint effort; some of them trace back to Shabbat Shira and the ur-escape from slavery in that story.

Shabbat Shira is named for the Torah portion we read this Shabbat, when the Israelites finally escape from Egypt, stand trembling and overwhelmed and almost defeated at the bank of the Red Sea until Aminadab has the faith to walk into the water and not drown in it and they follow him through it, watch Pharaoh’s army drown, and sing in triumph on the other side.

It is our people’s most foundational story, the story of how we gained our freedom, and it is not accidental that much of the story’s imagery fueled the civil rights movement.

The world we live in now certainly is far from perfect. Racism continues to be a divisive, dangerous, at times deadly force in this country. But we have changed a great deal since Dr. King was killed.

On the Friday before the three-day weekend that celebrated his life and legacy, the American Museum of Natural History opened its newest dinosaur exhibit, featuring a cast of a titanosaur.

The museum, on Manhattan’s Central Park West, is a series of old buildings, irrationally strung together, with elevators and staircases in odd places and big galleries reachable only through long treks through minor ones. It’s easy to get lost in it, although those of us who spent much time there when we either had or were young children have the sort of muscle memory that leads us through dim halls lined with beady-eyed stuffed animals and odd arrangements of rampant moose and angry mongeese and pensive buffalo to wherever it is that we’ve been going.

The dinosaur is the length of three school buses, we are told, and although the galleries are big none could fit more than about two and a half buses, it seems. So the dinosaur’s head pokes way out of the doorway, with that toothy grin that comes so naturally to creatures whose flesh has dissolved millennia ago.

We were there on Sunday, the day before we celebrated Dr. King’s birthday. Because it was a long weekend, and because the dinosaur is new and exciting, the place was packed.

And that’s the point. That’s where all this was going.

Everyone was there. Black and white and Asian and bi- or tri-racial kids and parents. Families with the men in kippot. Families with the women in headscarves. People who speak English and people who don’t. People who clearly are native New Yorkers and people who were on a once-in-a-lifetime trip to the Big Apple. Absolutely every group you could think of was represented.

If it hadn’t been for the Israelites leaving Egypt to look for the freedom eventually to become the Jews, if we hadn’t had that prototype of freedom, who knows how the world would have developed. And if the freedom hadn’t eventually extended to everyone in this country, we wouldn’t all have been together in that one room, gaping at that one big dinosaur.

That’s a good reason for us all to sing together.