Absolutley yes you can leave.
Its happened a few times with guys in my company, most recently last week.
The problem is things become more difficult when you come back.