Optical logic operation via plasmon-exciton interconversion in 2D semiconductors