In that case, leaving early would likely break your contract. Depending on what your contract says, two weeks' notice may not be enough keep you out of trouble. A contract is an agreement between two parties. It's your responsibility to uphold all the provisions of that deal, including the term about how long it lasts.