MATCH (a1:Author)-[co:COAUTHOR]-(a2:Author) WHERE co.year IN [2017,2018,2019,2020] RETURN a1,co,a2

The operator tests every year every time in array to compute a MATCHOR tests each year in array by index (starting from 2017 THEN going to 2018 ... 2020)

Im in doubt if need to use some logic to iterate the array of years, in this example, to compute the required MATCH.