
find_c::Char->String->(String,Bool)
find_c c []=([],False)
find_c c (x:xs)=if x == c then (xs,True) else find_c c xs

solver::String->Bool
solver xs = let (rest,b) = find_c 'A' xs in
            if b then let (_,b2) = find_c 'C' rest in
                      b2
                 else False

main::IO()
main= do
  str<-getLine
  putStr (if solver str then "Yes\n" else "No\n")