import sys import re for line in sys.stdin: [password, word] = line.split() print("Yes" if re.match(".*".join(f"^{password}$"), word) else "No")