import           Data.List

main :: IO ()
main = do
  [h, w] <- map read.words <$> getLine
  cs <- concat.words <$> getContents
  let freq = map length . group $ sort cs
  if even (h * w) && all even freq
  then putStrLn "YES"
  else if odd (h * w) && sum[1|f<-freq,odd f] == 1
  then putStrLn "YES"
  else putStrLn "NO"
