Capital Loss classifications

Say in year 1 I had $1500 Short-term loss and a $1000 Long-term loss.  In year 2 are the losses still categorized?

 

Meaning can I only apply gains from each type (short-term/long-term) to the same type of loss from previous year?

So, if in year 2 I have $2000 Short-Term gain and $500 Long-term gain, Will I be able to cancel out all my gains from year 2 with the carryover losses from year 1?

 

Thanks,