paying up... whats wrong with my code... please help

I am not getting whats wrong with my code…please help…:frowning:
here is my code http://www.codechef.com/viewsolution/4240095

I have not read the logic of your code …but…

First you must change the output from yes to Yes and no to No.

It causes WA.

my code is giving yes for every input…why is it so?
please check