Horses have the ability to sleep both standing up and lying down. While standing, they enter a light sleep state called "dozing" where they can relax their muscles but still remain alert to potential threats. This allows them to quickly flee if necessary. However, horses also need to lie down for deep REM sleep, which is essential for their overall well-being. They typically lie down for short periods of time, usually no more than a couple of hours, to get the rest they need. So, horses have the flexibility to sleep in both positions depending on their needs and the circumstances.