Edge modes in zigzag and armchair ribbons of monolayer MoS2