import Data.List
main = do
  getLine
  ns <- map read.words <$> getLine
  getLine
  ms <- map read.words <$> getLine
  putStrLn $ solve (sort ns) (sort ms)

solve :: [Int] -> [Int] -> String
solve _ [] = "Yes"
solve [] _ = "No"
solve nns@(n:ns) mms@(m:ms)
  | n == m    = solve ns ms
  | n < m     = solve ns mms
  | otherwise = "No"