x ? (a,b) = if x then a else b

main = do
 [s,t] <- lines<$>getContents
 putStr $ solve [s,t]

solve [s,t]
 | null s = (length t == 1)?("Yes","No")
 | head s == head t = solve (map tail [s,t])
 | otherwise = "No"
