import Control.Monad import Data.Graph import Data.Array import qualified Data.Set as S dfs' g s v | S.member v s = s | otherwise = foldl (dfs' g . S.insert v) s (g!v) main = do [n,m] <- map read . words <$> getLine ls <- replicateM m $ map read . words <$> getLine let g = buildG (0,n-1) [p | [a,b] <- ls, p <- [(a,b),(b,a)]] v = length $ filter (not . null) $ elems g r = S.size $ dfs' g S.empty (head $ head ls) o = length $ filter (odd . length) $ elems g putStrLn $ if v == r && o <= 2 then "YES" else "NO"