import Control.Applicative
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as BS
import Data.Maybe

readIntBS = fst . fromJust . BS.readInt

main = do
  [n,m] <- map read . words <$> getLine :: IO [Int]

  a <- all (\l -> even $ length l) . group . sort . concat . map (map readIntBS . BS.words) . BS.lines <$> BS.getContents :: IO Bool
  
  putStrLn $ if a then "YES" else "NO"
