Linear optics implementation for Yang-Baxter Equation