You will start your career on an unpleasant note.
Whether you succeed legally or not is the question.
The company is training you and inducting you-all this means expenditure and time for the company-after this you want to leave seeing different pastures.
I feel it is incorrect.
No wonder many employers try to put in more restrictive conditions.
Plan what you want to do and then only join.