What's am i getting WA in this solution?

https://www.codechef.com/viewsolution/57275470

I am getting no for this testcase, which i expected it to be
Can you please help me with this problem ??

It’s coming out as yes on my machine:

[simon@simon-laptop][19:26:31]
[~/devel/hackerrank/otherpeoples]>./codechef-download-solution.rb https://www.codechef.com/viewsolution/57275470
Solution written to: rahul12r-RAINBOWA.cpp
[simon@simon-laptop][19:26:41]
[~/devel/hackerrank/otherpeoples]>./compile-latest-cpp.sh 
Compiling rahul12r-RAINBOWA.cpp
Executing command:
  g++ -std=c++17 rahul12r-RAINBOWA.cpp -O3 -g3 -Wall -Wextra -Wconversion -DONLINE_JUDGE -D_GLIBCXX_DEBUG    -fsanitize=undefined -ftrapv
Successful
[simon@simon-laptop][19:26:47]
[~/devel/hackerrank/otherpeoples]>echo "1                                                       
7
1 2 3 7 3 2 1
" | ./a.out
yes