along long library corridor line seat decorative plant you give 0indexed string corridor length n consist letter S P S represent seat p represent plantOne room divider instal left index 0 right index n 1 additional room divider instal for position index 1 1 n 1 divid installeddivide corridor nonoverlapping section section exactly seat number plant there multiple way perform division two way different position room divider instal way second wayreturn number way divide corridor since answer large return modulo 109 7 if way return 0 example 1input corridor SSPPSPSOutput 3explanation there 3 different way divide corridorthe black bar image indicate room divider installednote way section exactly seatsexample 2input corridor PPSPSPOutput 1explanation there 1 way divide corridor instal additional dividersinstalling create section exactly seatsexample 3input corridor SOutput 0explanation there way divide corridor section exactly seat Constraintsn corridorlength1 n 105corridori S P