import Control.Monad
import Data.List

main :: IO ()
main = do
  [h,w] <- getInts
  as <- concat <$> replicateM h getLine
  let xs = sort $ map length $ group $ sort as
  putStrLn $ if solve h w xs then "Yes" else "No"

getInts :: IO [Int]
getInts = map read . words <$> getLine
  
solve :: Int -> Int -> [Int] -> Bool
solve h w xs | even h && even w = n <= (h*w `div` 4) && all (\k -> (k`mod`4)==0) xs
             | even h && odd w = n <= (h*(w+1) `div` 4) && all (\k -> even (k`mod`4)) xs && length (filter (==2) xs) <= h `div` 2
             | odd h && even w = n <= ((h+1)*w `div` 4) && all (\k -> even (k`mod`4)) xs && length (filter (==2) xs) <= w `div` 2
             | odd h && odd w = n <= ((h+1)*(w+1) `div` 4) && 1==(length $ filter odd xs) && length (filter (==2) xs) <= (w+h-2)`div`2
  where n = length xs
