part year resident state tax

Hi, I am a full-time employee of a consulting company in NY. I spent 34 days in Illinois and 28 days in Massachusetts at two client sites. Should I file part-year resident taxes in MA and IL?