{-# LANGUAGE ScopedTypeVariables #-}
import Control.Applicative
import Control.Monad
import Control.Monad.State
import Control.DeepSeq
import Data.Array
import Data.Bits
import Data.Char
import Data.Functor.Identity
import Data.List
import Data.Maybe
import Data.Ord
import Data.Tree
import Data.Tuple
import qualified System.IO
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.Sequence as Q
import qualified Data.ByteString.Char8 as B

main = do
  [n,m] <- getInts
  q <- getInt
  as <- getInts
  let goal = dropLastIncr $ lru m as
  -- print goal
  let g = S.fromList goal
  let rs = reverse $ filter (`S.member` g) as
  let result = if n * length goal > length rs
        then Nothing
        else (iterate (>>= dropGreedy goal) (Just rs)) !! n
  -- mapM_ print . take n $ iterate (>>= dropGreedy goal) (Just rs)
  putStrLn . yesNo $ isJust result

dropGreedy :: (Eq a) => [a] -> [a] -> Maybe [a]
dropGreedy [] xs = Just xs
dropGreedy _ [] = Nothing
dropGreedy (x:xs) (y:ys)
  | x == y  = dropGreedy xs ys
  | otherwise = (y :) <$> dropGreedy (x:xs) ys

lru m as = let
  lasts = accumArray min 1 (1,m) $ zip as [0,-1..]
  in  map snd . sort . map swap $ assocs lasts

dropLastIncr = reverse . foo . reverse  where
  foo xs = map snd . dropWhile (uncurry (>)) $ zip xs (tail xs)
 
type Z = Int
type Q = Rational
type R = Double
type S = String

fint :: (Integral a, Num b) => a -> b
fint = fromIntegral

getInt = fst . fromJust . B.readInt <$> B.getLine
getIntPair = (\[a,b]->(a,b)) <$> getInts
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine
getStr = B.unpack <$> B.getLine

yesNo :: Bool -> String
yesNo True = "Yes"
yesNo False = "No"

printList :: (Show a) => [a] -> IO ()
printList = putStrLn . unwords . map show

readLnList :: (Read a) => IO [a]
readLnList = map read . words <$> getLine


-----  Union-find
type UnionFindT v m a = StateT (M.Map v (UnionFindVal v)) m a
newtype UnionFindVal v = UnionFindVal v

runUnionFindT :: (Monad m) => UnionFindT v m a -> m a
runUnionFindT = flip evalStateT $ M.empty

runUnionFind = runIdentity . runUnionFindT

ufFresh :: (Monad m, Ord v) => v -> UnionFindT v m ()
ufFresh v = modify $ M.insert v (UnionFindVal v)

ufClass :: (Monad m, Ord v) => v -> UnionFindT v m v
ufClass v = do
  (UnionFindVal pv) <- gets (M.! v)
  if v == pv
    then return v
    else do
      c <- ufClass pv
      modify $ M.insert v (UnionFindVal c)
      return c

ufUnify v w = do
  cv <- ufClass v
  cw <- ufClass w
  modify $ M.insert cw (UnionFindVal cv)
  return $ cv /= cw
