check_year function

Checks if year is valid