peterverebics/CodeNet_Python_118 huggingface dataset:
S, T = input(), input()
if S == T[:-1]:
    print('Yes')
else:
    print('No')
S = list(input())
T = list(input())
T.pop(-1)
if S==T:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if T[:-1] == S:
    print('Yes')
else:
    print('No')
S=input()
T=input()
if T[:-1]==S[:]:
  print('Yes')
else:
  print('No')
S=input()
T=input()
if S==T[:-1]:
    print("Yes")
else:
    print("No")
s = input()
t = input()

if t[:-1] == s:
    print("Yes")
else:
    print("No")
s = input()
t = input()
if s == t[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if S == T[:len(S)]:
    print('Yes')
    exit()

print('No')
s = input()
t = input()

cnt = len(s)

if s[:cnt] == t[:cnt]:
    if len(t) == cnt + 1:
        print('Yes')
        exit()

print('No')
S = input()
T = input()

if len(T) == 2 and S[0] == T[0]:
    print("Yes")
else:
    if S[0] == T[0]:
        T = T.replace(S,"")
        if len(T)==1:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
s = input()
t = input()

if s == t[:-1] and len(s) == len(t)-1:
    print("Yes")
else:
    print("No")
s=input()
t=input()

if t[:-1]==s:
    print("Yes")
else:
    print("No")
S = input()
T = input()

for s,t in zip(S,T):
    if s != t:
        print('No')
        exit()
print('Yes')
s = input()
t = input()
o = t[:-1]
if ( o == s ):
    print('Yes')
else:
    print('No')
# -*- coding: utf-8 -*-
s = input()
t = input()
id = s + t[-1:]

if t == id:
    print('Yes')
else:
    print('No')
s = input()
t = input()
if s==t[:len(t)-1]:
    print('Yes')
else:
    print('No')
a = [str(input()) for i in range(2)]
s = a[0]
t = a[1]
s_l = len(s)
S = s + t[s_l]
if S == t:
  print('Yes')
else:
  print('No')
original = input()
new = input()
num = len(original)
ans = "Yes"

for i in range(num):
  if original[i] != new[i]:
    ans = "No"
    break
print(ans)
s = input()
t = input()

if s == t[:len(t)-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()
 
T = T[:-1]
if S == T:
  print("Yes")
else:
  print("No")
S = input()
T = input()
if S == T[:-1]:
    print('Yes')
else:
    print('No')
S=input()
T=input()

a=T.find(S)

if (S in T) and a==0:
  print('Yes')
else:
  print('No')
from itertools import zip_longest
s = input()
j = input()

for x,y in zip_longest(s,j):
  if x != None and x != y:
    print("No")
    break
  if x == None:
    print("Yes")
s = input()
t = input()
if len(s)+1 == len(t) and s == t[:len(t)-1]:
  print("Yes")
else:
  print("No")
#A
S = input()
T = input()

if ((len(T) - len(S)) == 1) and (S == T[0:len(S)]):
    print("Yes")
else:
    print("No")
ans = input()
que = input()
l = len(que)
que_s = que[:l-1]
if ans == que_s:
    print("Yes")
else:
    print("No")
s = input()
t = input()
l = len(s)
if t[:l] == s[:l]:
    print('Yes')
else:
    print('No')
S=input()
T=input()
if S==T[:-1]:
  print('Yes')
else:
  print('No')
S = input()
T = input()
if len(S)+1 == len(T) and S == T[:len(S)]:
  print("Yes")
else:
  print("No")
s = input()
t = input()
l = len(t)
if s == t[:l-1]:
    print('Yes')
else:
    print('No')
s=input()
t=input()
if t[:-1]==s:
  print('Yes')
else:
  print('No')
S = input()
T = input()

if (S == T[:-1]) and (len(S)+1 == len(T)):
    print('Yes')
else:
    print('No')
s = str(input())
t = str(input())

if(t.startswith(s)):
    print("Yes")
else:
    print("No")
s = input()
t = input()
if len(t) == len(s) + 1:
  if s == t[:len(t) - 1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
s = input()
t = input()

if s == t[0:-1]:
    print("Yes")
else:
    print("No")
S = str(input())
T = str(input())

if T.startswith(S) ==True:
    print("Yes")
else:
    print("No")
n = input()
s = input()

if n == s[:-1] and len(n) == len(s)-1:
    print('Yes')
else :
    print('No')
s = input()
t = input()
if s == t[:len(s)]:
  print('Yes')
else:
  print('No')
s = input()
t = input()
if t[:len(s)] == s:
    print('Yes')
else:
    print('No')
S=input()
T=input()
print("Yes" if S==T[:len(T)-1] and len(S)+1==len(T) else "No")
s = str(input())
t = str(input())
a = 0
for i in range(0,len(s)):
    if s[i] != t[i]:
        a = 1
        break
if a == 0:
    print('Yes')
else:
    print('No')
s = input()
t = input()
print("Yes" if s == t[:-1] else "No")
s = input()
t = input()
if s == t[:-1]: print("Yes")
else: print("No")
import sys
S = sys.stdin.readline().strip()
T = sys.stdin.readline().strip()
if T[:-1] == S:
    print("Yes")
else:
    print("No")
s = input()
t = input()

al = "abcdefghijklmnopqrstuvwxyz"

for x in al:
	if s + x == t:
		print('Yes')
		break

else:
	print('No')
S = input()
T = input()

S = S + T[-1]
if S == T:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    s = S()
    t = S()

    if s==t[:-1]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    resolve()
s = input()
t = input()

t_tmp = t[0:len(t)-1]
if s == t_tmp:
    print('Yes')
else:
    print('No')
s=input()
t=input()
c=0
for i in range(len(s)):
  if s[i]!=t[i]:
    c=1
    break
if c==0:
  print("Yes")
else:
  print("No")
S = input()
T = input()
if(T[:len(S)] == S):
    print('Yes')
else:
    print('No')
S = input()
T = input()
if T[:-1] == S:
    print("Yes")
else:
    print("No")
S=input()
T=input()
if len(T)-len(S)==1 and S==T[:-1]:
  print('Yes')
else:
  print('No')
S=str(input())

T=str(input())

l=len(S)
ans=0
for i in range(l):
    if S[i]!=T[i]:
        ans=ans+1
if ans==0:
    print('Yes')
else:
    print('No')
s = input()
t = input()
l = len(s)
if s == t[:l]:
  print('Yes')
else:
  print('No')
s = input()
t = input()
check = t[:-1]
a = len(s)
b = len(t) - 1
if a == b:
    if s == check:
        print("Yes")
    else:
        print("No")
else:
    print("No")
#!/usr/bin/env python3


def main():
    S = input()
    T = input()
    if S == T[:len(S)]:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()
S=input()
T=input()
T=T[0:len(T)-1]
if(S==T):
    print("Yes")
else:
    print("No")
s = input()
t = input()
 
flag = True
for i in range(len(s)):
  if s[i] is not t[i]:
    flag = False
if flag is True:
  print("Yes")
else:
  print("No")
s = input()
t = input()

if s == t[:-1]:
  if len(s) + 1 == len(t):
    print('Yes')
else:
  print('No')
S = input()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")
T = input()
S = input()

if T == S[:-1]:
	print('Yes')
else:
	print('No')
S=input()
T=input()

for i in range(len(S)):
  if S[i]==T[i]:
    continue
  else:
    print('No')
    exit()
if len(S)+1 ==len(T):
  print('Yes')
else:
  print('No')
s=input()
t=input()
f=True
for i in range(len(s)):
  if s[i]!=t[i]:
    f=False
    break
print('Yes' if f and len(s)+1==len(t) else 'No')
def c167(x):
    if x[1][:-1] == x[0]: return "Yes"
    else: return "No"

    
if __name__=="__main__":
    input1 = input()
    input2 = input()
    input3 = [input1,input2]
    print(c167(input3))
import string

S = input()
T = input()

for a in string.ascii_lowercase:
    if S + a == T:
        print('Yes')
        exit()

print('No')
s = input()
p = input()

p = p[:-1]
#print(p)


if s == p:
  print("Yes")
else:
  print("No")
a = input()
x = [a[i:i+1] for i in range(len(a))]

b = input()
y = [b[i:i+1] for i in range(len(b))]
n=0
for i in range(len(x)):
    n = n+1
    if x[i] != y[i]:
        print("No")
        break

if n == len(a) and x[len(a)-1]==y[len(a)-1]:
    print("Yes")
S = str(input())
T = str(input())

if T.startswith(S) and len(S)+1 ==len(T):
    print("Yes")
else:
    print("No")
s = input()
t = input()
n = len(s)
if s == t[:n]:
    print('Yes')
else:
    print('No')
if __name__ == "__main__":
    S = input()
    T = input()

    lenS = len(S)
    if (T[:lenS] == S and len(T) == lenS + 1):
        print("Yes")
    else:
        print("No")
S = str(input())
T = str(input())

if T[:-1] == S:
  print('Yes')
  
else:
  print('No')
S = input()
T = input()

ans = 'Yes'
for i in range(len(S)):
  if S[i] != T[i]: 
    ans = 'No'
    break

print(ans)
s = input()
t = input()
if s == t[:-1]:
  print('Yes')
else:
  print('No')
S = input()
T = input()
if S == T[:-1] and (len(S)+1)==len(T):
  print('Yes')
else:
  print('No')
S= str(input())
T= str(input())
#N,M,X = map(int,input().split())
#N = int(input())
#A = list(map(int,input().split()))

if T[:-1]==S:
    print('Yes')

else:
    print('No')
n = input()
m = input()

if len(n) + 1 == len(m) and n == m[:len(n)]:
  print('Yes')
else:
  print('No')
s= input()
t= input()

if len(s) <= 10 and t[0:len(s)]==s and len(t)==len(s)+1:
  print('Yes')
else: 
  print('No')
S = input()
T = input()

if len(S) + 1 == len(T) and T.startswith(S):
    print('Yes')
else:
    print('No')
s=str(input())
t=str(input())

if t[:-1]==s:
    print("Yes")
else:
    print("No")
import sys
import math  # noqa
import bisect  # noqa
import queue  # noqa


def input():
    return sys.stdin.readline().rstrip()


def main():
    S = input()
    T = input()

    if S == T[:-1]:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
s = input()
t = input()
if s == t[:-1] and 1<=len(s)<=10:
    print('Yes')
else:
    print('No')
# A
S = input()
T = input()
ans = 'No'
if S == T[:-1]:
    ans = 'Yes'
print(ans)
S = input()
T = input()
Ans = T.startswith(S)
if Ans == True:
  print("Yes")
else:
  print("No")
s = input()
t = input()

if len(s) + 1 != len(t):
    print("No")
elif s != t[:len(s)]:
    print("No")
else:
    print("Yes")
s = str(input())
t= str(input())
sl = len(s)
tl = len(t)

if(t[:-1]==s):
    print('Yes')

else:
    print('No')
# -*- coding: utf-8 -*-

def main():
# 整数の入力
    
    s1 = input()
    s2 = input()
    # 出力
    if s2[:-1] == s1:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
a=input()
b=input()

z=b[:-1]

c=len(a)
d=len(b)-1

if a==z and c==d:
    print('Yes')
else:
    print('No')
s1=list(str(input()))
s2=list(str(input()))
a=s2.pop()
if(s1==s2):
    print("Yes")
else:
    print("No")
S = input()
T = input()

for i, s in enumerate(S):
    if s != T[i]:
        print("No")
        break
else:
    print("Yes")
S = input()
T_l = [i for i in input()]
T_x = ''.join(T_l[0:-1])
if S==T_x:
    print('Yes')
else:
    print('No')
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

import sys
sys.setrecursionlimit(4100000)
rl = sys.stdin.readline

s = input()
t = input()

flag = 1
l = len(s)

for i in range(l):
    if s[i]!=t[i]:
        flag = 0
        break
        
if flag == 1:
    print('Yes')
else:
    print('No')
s = input()
t = input()

if s == t[:-1]:
  print("Yes")
else:
  print("No")
s = input()
t = input()

if s==t[0:-1]:
    print("Yes")
else:
    print("No")
s = input()
t = input()
if t == s + t[-1]:
	print ("Yes")
else:
	print ("No")
str1 = input()
str2 = input()
str2 = str2[:len(str1)]
# print(str1)
# print(str2)
if str1 == str2:
    print("Yes")
else:
    print("No")
#!/usr/bin/env python
"""AtCoder Beginner Contest 167: A - Registration
https://atcoder.jp/contests/abc167/tasks/abc167_a
"""


def main():
    S = input()
    T = input()

    if S == T[0:-1]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
S = input()
T = input()

if S == T[:len(T)-1]:
  print('Yes')
else:
  print('No')
s=input()
t=input()
if t[:len(s)]==s:
    print("Yes")
else:print("No")
S = list(str(input()))
T = list(str(input()))

if S == T[:-1]:
    print("Yes")
else:
    print("No")
s = input()
t = input()

if (s == t[:-1]) & (len(s) + 1 == len(t)):
    print("Yes")
else:
    print("No")
S = input()
T = input()

if S == T[:-1] and len(S)+1 == len(T):
    print('Yes')
else:
    print('No')
S=input()
T=input()
if len(T)!=len(S)+1:
  print('No')
  exit()
if S!=T[:-1]:
  print('No')
  exit()
print('Yes')
import sys

N = input()
M = input()
M = M[:-1]
if( N == M):
  print('Yes')
  sys.exit()
print('No')
def main():
  s = input()
  t = input()
  t = t[0:len(t)-1]
#  print(s,t)
  ans = 'Yes' if s == t else 'No'
  print(ans)
  
if __name__ == '__main__':
  main()
S = input()
T = input()
if len(S)+1 == len(T) and S == T[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()
if S==T[:-1:]:
    print("Yes")
else:
    print("No")
S = input()
T = input()

a = T.find(S)
if a == 0:
    T = T[len(S):]
    if len(T) == 1:
        print("Yes")
    else:
        print("No")
else:
        print("No")
S = input()
T = input()

if(S==T[0:len(S)]):
  print('Yes')
else:
    print('No')
s = input()
t = input()

if len(s) >= 1 and len(s) <= 10 and len(t) == len(s) + 1 and t.startswith(s):
  print("Yes")
else:
  print("No")
s = input().strip()
t = input().strip()
if t[:-1] == s:
    print("Yes")
else:
    print("No")
def resolve():
    import sys

    input = lambda: sys.stdin.readline().rstrip()

    s = input()
    t = input()
    print("Yes" if t.startswith(s) else "No")



resolve()
s = str(input())
t = str(input())
slen = len(s)
if s[:] == t[:slen]:
  print('Yes')
else:
  print('No')
S = input()
T = input()

if T[0:len(S)] == S:
    print('Yes')
else:
    print('No')
from collections import *

S = input()
T = input()

if S==T[:-1]:
    print('Yes')
else:
    print('No')
import sys
def main():
    S=sys.stdin.readline().strip()
    T=list(sys.stdin.readline().strip())
    T=''.join(T[:-1])
    print('Yes') if S==T else print('No')
if __name__=='__main__':main()
s = list(input())
t = list(input())
t.pop(-1)
if s==t:
    print("Yes")
else:
    print("No")
s = list(input())
t = list(input())
leng = len(s)
if s[0:leng] == t[0:leng]:
    print("Yes")
else:
    print("No")
s = [input() for i in range(2)]

s_length = len(s[0])
s2_length = len(s[1])

if s2_length==s_length+1 and s[0]==s[1][:s_length]:
    print("Yes")
else:
    print("No")
def main():
    S = input()
    T = input()

    if S == T[:-1]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
s1=input()
s2=input()

if s1 == s2[:-1]:
    print('Yes')
else:
    print('No')
S = input()
T = input()

for i in range(len(S)):
    if S[i] != T[i]:
        print('No')
        break
    elif S[i] == T[i] and i == len(S)-1:
        print('Yes')
    else:
        pass
S1 = list(input())
S2 = list(input())
S1.append(S2[-1])
if S1==S2:
    print("Yes")
else: print("No")
s = input()
print("YNeos"[input()[:-1]!=s::2])
s = str(input())
t = str(input())


if  1 <= len(s) and len(s) <= 10 and len(t) == len(s) + 1 and t.startswith(s):
  print("Yes")
else:
  print("No")
s = input()
t = input()

if t.startswith(s):
    print("Yes")
else:
    print("No")
S=list(map(str,input()))
T=list(map(str,input()))
#print(T[0:-1])
print("Yes" if T[0:-1]==S else "No")
s = input()
t = input()
print('Yes' if s==t[:-1] else 'No')
import string

def main():
    s, t = input(), input()
    ans = 'Yes' if solve(s, t) else 'No'
    print(ans)


def solve(s, t):
    if len(s) + 1 != len(t):
        return False
    for i, j in zip(s, t):
        if i != j:
            return False
    return True


if __name__ == '__main__':
    main()
S = input()
T = input()

if T[:len(S)] == S:
    print("Yes")
else:
    print("No")
s = input()
t = input()
print('Yes' if s == t[:-1] and len(s) == len(t) - 1 else 'No')
S=input()
T=input()
import sys
for i in range(len(S)):
  if S[i]!=T[i]:
    print("No")
    sys.exit()
print("Yes")
s = input()
t = input()
if len(s) == len(t)-1:
    flag = 0
    for i in range(len(s)):
        if s[i] == t[i]:
            pass
        else:
            flag = 1
            break
    if flag:
        print("No")
    else:
        print("Yes")
else:
    print("Yes")
s=input()
t=input()
fail=0
for i in range(len(s)):
  if s[i]!=t[i]:
    fail=1
if fail==1:
  print('No')
else:
  print('Yes')
s = input().rstrip()
t = input().rstrip()

if s == t[0:-1]:
  print('Yes')
else:
  print('No')
def main():
    first_try = input()
    second_try = input()

    if first_try == second_try[:-1]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
S = input()
T = input()

if len(S)+1 == len(T) and S == T[:-1]:
    print('Yes')
else:
    print('No')
a = input()
b = input()
print(a == b[:-1] and "Yes" or "No")
s = str(input())
t = str(input())

if t[:len(t)-1] == s:
    print('Yes')
else:
    print('No')
S=input()
T=input()

if S==T[:-1]:
    print('Yes')
else:
    print('No')
a = [input() for i in range(2)]

key1 = a[0]
key2 = a[1]
key2_front = a[1][:-1]
key2_back = a[1][-1]

if (key1 == key2_front):
    if len(key1) == len(key2_front):
        if len(key2_back) == 1:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
S = list(input())
T = list(input())

T.pop()

if S==T:
    print("Yes")
else:
    print("No")
import sys
readline = sys.stdin.buffer.readline
s =readline().rstrip().decode()
t =readline().rstrip().decode()

if t[:-1] == s:
  print('Yes')
else:
  print('No')
s=input()
t=input()
import sys
for i in range(len(s)):
    if s[i]==t[i]:
        pass
    else:
        print("No")
        sys.exit()
print('Yes')
s = input()
t = input()[:-1]

if s == t:
  print("Yes")
else:
  print("No")
S = input()
t = input()
x = len(S)
T = t[:x]
if S == T:
    print("Yes")
else:
    print("No")
S = input()
T = input()

print("Yes" if S == T[:-1] else "No")
S = input()
T = input()
if T[:-1] == S:
    print('Yes')
else:
    print('No')
s=input()
t=input()
if s==t[:-1]:
    print("Yes")
else:
    print("No")
s=input().strip()
t=input().strip()
print('Yes' if s==t[:-1] else 'No')
s = input().strip()
t = input().strip()

if s == t[:len(t) - 1]:
    print('Yes')
else:
    print('No')
import sys
input = lambda: sys.stdin.readline().rstrip()

S = input()
T = input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if T[:len(S)] == S:
    print('Yes')
else:
    print('No')
S=str(input())
T=str(input())
co=0
cou=0
lista=[]
listb=[]
for i in S:
    co+=1
    lista.append(i)
for j in T:
    cou+=1
    listb.append(j)
del listb[-1]
if lista==listb:
    if cou-co==1:
        print("Yes")
    else:
        print("No")
else:
    print("No")
S = input()
T = input()
l = len(T)
print('Yes') if S == T[:l - 1] else print('No')
# A Registration

s = input()
t = input()

if len(s) + 1 != len(t):
  print("No")
  exit()

for i in range(len(s)):
  if s[i] != t[i]:
    print("No")
    exit()

print("Yes")
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    s = ns()
    t = ns()

    if s == t[:-1]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
S = input()
T = input()
print('Yes' if T[:-1] == S else 'No')
a = input()
b = input()
if b.startswith(a) and len(a) == (len(b) -1):
    print("Yes")
else:
    print("No")
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


S=input()
T=input()

if T[0:len(S)]==S:
	print("Yes")
else:
	print("No")
s=list(input())
t=list(input())
if s==t[:-1]:
  print("Yes")
else:
  print("No")
s = input()
t = input()
print('Yes') if t == s+t[-1] else print('No')
S, T = input(), input()
if S == T[:-1] and len(S) - len(T) == -1:
    print('Yes')
else:
    print('No')
S=input()
T=input()

if S == T[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()
msg = "Yes"
for i in range(len(S)):
    if T[i] != S[i]:
      msg = "No"
      break
print(msg)
s = input()
t = input()
num = len(s)
if len(t) != num+1:
    print('No')
    quit()
    
if t[:num]==s:
    print('Yes')
else:
    print('No')
from sys import stdin
import sys
import math

# A, B, C = [int(x) for x in stdin.readline().rstrip().split()]
# A, B = [int(x) for x in stdin.readline().rstrip().split()]
# U = input().split()
S = input()
T = input()
# print(T[:-1])
if S == T[:-1] and len(S) == len(T)-1:
    print('Yes')
else:
    print("No")
A=list(input())
B=list(input())
del B[-1]
if A==B:
  print("Yes")
else:
  print("No")
S = input(); T = input()

if S + T[-1] == T:
  print("Yes")
else:
  print("No")
a=input()
b=input()
s=len(a)
if b[:s]!=a:
    print("No")
else:
    print("Yes")
s = input()
t = input()
if(len(t)!=len(s)+1):
    print("No")
else:
    if(s==t[:len(s)]):
        print("Yes")
    else:
        print("No")
S=input()
T=input()
if (not S.isalpha()) or (not T.isalpha()):
    print('No')
elif len(S)>10:
    print('No')
elif len(S)+1!=len(T):
    print('No')
elif T[:len(S)]!=S:
    print('No')
else:
    print('Yes')
S = input()
T = input()

check1 = S
check2 = T[:-1]

if check1==check2:
  print("Yes")
else:
  print("No")
s=input()
t=input()
ans=0
l=len(s)
for i in range(l):
    if s[i]!=t[i]:
        ans=1
        break
print("Yes" if ans==0 else "No")
s=input();print('NYoe s'[s==input()[:len(s)]::2])
o = input()
k = input()
print("Yes" if len(o) + 1 == len(k) and k[:-1] == o else "No")
S=input()
T=input()

if S==T[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if T.startswith(S) and len(T) == len(S) + 1:
  print("Yes")
else:
  print("No")
import sys
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, d=DVSR): return pow(x, d - 2, d)
def DIV(x, y, d=DVSR): return (x * INV(y, d)) % d
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())

S=input()
T=input()

if len(S) == len(T)-1 and S == T[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if S == T[:-1]:
	print("Yes")
else:
	print("No")
S = str(input())
T = str(input())

alpha_list = [chr(ord('a') + i) for i in range(26)]

for j in alpha_list:
  if T == S + j:
    print('Yes')
    break
else:
  print('No')
s=input()
t=input()
if s[0:]==t[0:-1]:
    print("Yes")
else:
    print("No")
s = str(input())
t = str(input())
if t==s+t[-1]:
    print("Yes")
else:
    print("No")
s = input()
t = input()

if s == t[0:len(t)-1] and len(s)+1 == len(t):
    print('Yes')
else:
    print('No')
S = input()
T = input()
if len(S)+1 == len(T):
  if S == T[:-1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")
a=str(input())
b=str(input())
ans=0
for i in range(len(a)):
    if a[i]==b[i]:
        ans+=1
if ans==len(a):
    print('Yes')
else:
    print('No')
s = input()
t = input()
if s == t[:-1]:
    print('Yes')
else:
    print('No')
S = input()
T = input()

def f(S, T):
    if len(T) - len(S) != 1:
        return 'No'
    for i in range(len(S)):
        if S[i] != T[i]:
            return 'No'
    return 'Yes'

print(f(S, T))
S = str(input())
T = str(input())
if S == T[:-1]:
    print('Yes')
else:
    print('No')
s = input()
t = input()

if t.startswith(s):
    print('Yes')
else:
    print('No')
def main():
    S = input()
    T = input()

    if(T[0:len(T)-1] == S):
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()
S = str(input())
T = str(input())

if T[:-1] == S:
    print("Yes")
else:
    print("No")
s = input()
t = input()
if len(t) == len(s) + 1 and t[:-1] == s:
    print("Yes")
else:
    print("No")
s = input()
t = input()
if s==t[:-1]:
    print('Yes')
else:
    print('No')
S = input()
T = input()

if S==T[:-1]:
    print('Yes')
else:
    print('No')
S=input()
T=input()
n=len(S)
if S == T[0:n]:
    print("Yes")
else:
    print("No")
s = input()
t = input()

if s == t[:-1]:
	print("Yes")
else:
    print("No")