C - 文字列の書き換え Editorial /

Time Limit: 2 sec / Memory Limit: 256 MB

Problem Statement

すぬけ君は、新年のプレゼントに文字列 s をもらった。以下の操作を繰り返すことで s をすぬけ君の好きな文字列 t にできるかどうか判定せよ。

操作: s から文字を一つ選び、その直後に選んだ文字とは異なる文字を一つ挿入する。


Constraints

  • 1 \leq |s| \leq |t| ≤ 5000
  • s, t は英小文字のみからなる

Input Format

入力は以下の形式で標準入力から与えられる。
s
t

Output Format

Yes または No と出力せよ。

Sample Input 1

snuke
snukent

Sample Output 1

Yes

Sample Input 2

snuke
ssnuke

Sample Output 2

No