Doubt in sample input

There is a ‘#’ in the last row, which means that the row is blocked, then how can he get out of the park?

@Paras-Kaushik-446920412565840 hey paras using break statement you will get out of it.

I am not asking that. I’m asking that if the last row is blocked, then he shouldn’t be able to get out of the park and the answer should be “No”. But it is printed “Yes” in the sample output. Why?

@Paras-Kaushik-446920412565840 hey paras Visit this link