Your clue is the yellow/black...
Yes, it's a resistor. Diagram doesn't say what it's for, but the Y/B wire goes to the hi/low headlight switch. If I'm not mistaken, '77 was the first year of the reserve lighting system. I suspect the resistor is there to give reduced power to the hi beam if (when) the low beam burns out. I know on later bikes that's all contained in the RLU, but perhaps Yamaha used an external resistor on the '77?
View attachment 264149