fork download
  1. import Data.List
  2.  
  3. r[]="YES";r(a)="NO";p(s)=r.tail.filter odd.map length.group$sort s
  4.  
  5. main =
  6. print $ map p [
  7. "aab",
  8. "abc",
  9. "racecar",
  10. "aaa"
  11. ]
  12.  
Success #stdin #stdout 0.01s 5408KB
stdin
Standard input is empty
stdout
["YES","NO","YES","YES"]