module Main where

solve s = "Yes\n" ++ (tautology $ map firstSymbol $ tail $ lines s) ++ "\n"

firstSymbol s = head $ dropWhile (== ' ') s

tautology list = concatMap (: " | ") list ++ "~" ++ [head list]

main = do
  s <- readFile "important.in"
  writeFile "important.out" $ solve s
