Sgt. Pepper's Lonely Hearts Club Band is the eighth studio album by English rock band the Beatles. Released on 26 May 1967 in the United Kingdom and 2 June 1967 in the United States, it was an immediate commercial and critical success, spending 27 weeks at the top of the UK albums chart and 15 weeks at number one in the US. On release, the album was lauded by the vast majority of critics for its innovations in music production, songwriting and graphic design, for bridging a cultural divide between popular music and high art, and for providing a musical representation of its generation and the contemporary counterculture.

In November 1966, during a return flight to London from Kenya, where he had been on holiday with Beatles tour manager Mal Evans, McCartney had an idea for a song that eventually formed the impetus of the Sgt. Pepper concept. His idea involved an Edwardian-era military band, for which Evans invented a name in the style of contemporary San Francisco-based groups such as Big Brother and the Holding Company and Quicksilver Messenger Service. In February 1967, McCartney suggested that the Beatles should record an entire album that would represent a performance by the fictional band. This alter ego group would give them the freedom to experiment musically. He explained: "I thought, let's not be ourselves. Let's develop alter egos." Martin remembered:  "Sergeant Pepper" itself didn't appear until halfway through making the album. It was Paul's song, just an ordinary rock number ... but when we had finished it, Paul said, "Why don't we make the album as though the Pepper band really existed, as though Sergeant Pepper was making the record? We'll dub in effects and things." I loved the idea, and from that moment on it was as though Pepper had a life of its own.  In 1966, the American musician and bandleader Brian Wilson's growing interest in the aesthetics of recording and his admiration for both record producer Phil Spector's Wall of Sound and the Beatles' album Rubber Soul resulted in the Beach Boys' Pet Sounds LP, which demonstrated his production expertise and his mastery of composition and arrangement. The author Thomas MacFarlane credits the release with influencing many musicians of the time, with McCartney in particular singing its praises and drawing inspiration to "expand the focus of the Beatles' work with sounds and textures not usually associated with popular music". McCartney thought that his constant playing of the album made it difficult for Lennon to "escape the influence", adding: "It's very cleverly done ... so we were inspired by it and nicked a few ideas." Martin stated: "Without Pet Sounds, Sgt. Pepper never would have happened ... Pepper was an attempt to equal Pet Sounds."  Freak Out! by the Mothers of Invention has also been cited as having influenced Sgt. Pepper. According to the author Philip Norman, during the Sgt. Pepper recording sessions McCartney repeatedly stated: "This is our Freak Out!" The music journalist Chet Flippo states that McCartney was inspired to record a concept album after hearing Freak Out!, considered the first rock concept album. Answer this question using a quote from the following article:

What inspired the album Sgt. Pepper's Lonely Hearts Club Band?
during a return flight to London from Kenya, where he had been on holiday with Beatles tour manager Mal Evans,