Yang-Baxter Relations for Spin Models and Fermion Models