Do subletters have rights
I am subletting on a lease with the leaseholder still living in the apartment. He signed for the whole apartment, and two others of us are renting the other two bedrooms and paying him rent. There is no written agreement, but I a careful to detail everything in the memo line on the checks. So, tenancy at will I think. The problem is, he got upset this weekend while I was at work (so I still don't know what about) and changed the locks. He texted me to inform me of this. I know that I should get a 30 day rental period notice. I always pay on time and keep the house very neat. My own space is cluttered as I still haven't unpacked, but my door is locked and closed all the time and I am hardly ever there, so that shouldn't be an issue.
Do I have the right to enforce my 30 day notice and how do I get into my apartment to get my things? Currently in a hotel. Thanks!
Edit: located in Massachusetts