Fans of the award-winning AMC cable TV series “Mad Men” are anxiously awaiting the series finale on Sunday, but many longtime viewers may not be aware that the show about Madison Avenue advertising agency executives was partly inspired by a movie about an accountant.

The creator of the show, Matthew Weiner, told an audience at a Brooklyn film retrospective recently that a 1965 movie called “Mirage,” starring Gregory Peck, was one of the inspirations behind “Mad Men,” according to an article on Fast Company. In the movie, Peck plays an accountant suffering from a case of amnesia. Hopefully it happens after tax season so he doesn’t forget to file his clients’ tax returns.

According to Leonard Maltin’s “Movie Guide,” Walter Matthau steals the movie in his role as an “easygoing private eye.” If Peck’s character had gotten into forensic accounting, he could have teamed up with the private eye.

The Fast Company article, by Mark Wilson, shows how the look of many of the shots is similar in the movie and the TV series, including the image of a man plummeting to the ground from a skyscraper at the opening of each “Mad Men” episode. At the end of the article, there’s an appreciative reader comment posted by Gregory Peck’s daughter, Cecilia Peck, who points out that the show may also have been inspired by another of her father’s films, “The Man in the Grey Flannel Suit.”

The question for “Mad Men” fans is whether Jon Hamm’s character, Don Draper, will end up being the man jumping from the window in the final episode. We’ll have to tune in to find out.