The salvage yard will be able to tell you what years interchange. But as long as the glass is the same, it doesn’t have to be from the same year vehicle.
Usually cars are basically the same for a few years with only Minor changes made from year to year. window glass should be the same as long as the whole car is essentially the same.