Basically if you leave before your contracted notice period you will be in breach of contract.
However, this is a civil matter and all your employer could do is sue you for any loss they suffered by you departing early. Generally speaking it is very difficult for them to prove they have suffered a loss and it would cost so much money and time it probably is not worth their while doing so. They would also have to show they did everything they could to mitigate any loss when you left early, such as immediately advertising for a replacement etc.
Generally speaking, for the vast majority of people, leaving early is not really a legal problem but it depends if you don’t mind pi$$ing them off completely and appearing unprofessional.
Do you need them for a reference or is it possible you may want to work for them again?