Yes. My doctor gives it to me for cruises as I am trapped in the cabin with my wife who has been known to snore like a freight train.
By the way we are going to Europe next year. Two of the legs will be long enough that she will no doubt sleep during them. If you find yourself on these flights, I will share the sleeping pills with the entire cabin.