Excellent. But there must be sufficient space for the head to be able to sit straight on that bed, and of course, a corridor to stand up straight.
Discussion
Have you seen those Japanese sleeping pod hostels? They have that space, with little drinks compartments, screen etc.
But yes, so long as you can get out and walk around before you go back to sleep.