I am getting correct answers for any input but on submitting it shows wrong answer can anyone help me to find out where is the problem in the code…

code link - https://www.codechef.com/viewsolution/26836284

brief about my logic -

i divided the a[m] array into parts where each part is of n(no. of cats) units,

and checked if any value is repeated in a part if repeated i printed no

else printed yes…