Gary Ballance and Adil Rashid hit chanceless centuries as Yorkshire reached 332-5 on day one against Somerset at Headingley.