If YC partners are on the board as YC rather than as individuals, then YC as a whole has a Duty of Loyalty to that company and could not sit the other board or invest as a Major Investor. There are scenarios though where the individual at YC is on a board as themselves, and YC invests in another company where unrelated group partners are the ones working on the investment and that is fine.
Disclosure: not a lawyer, YC is a Major Investor in my startup.