validate beginning and ending year