Yes. surely, two hours of quality sleep is far better than no sleep at all. These two hours of sleep will help you regain some energy for the next day morning and you will feel less sleepy and tired the next day when compared to no sleep at all.  Sleep is essential for your body to repair tissues, replenish hormones, and for efficient working of long-term and short-term memory. It is also required for the stable maintenance of your mood. Hence, any amount of sleep is way better than deciding to not sleep at all.