peterverebics/CodeNet_Python_118 huggingface dataset:
s=input()
t=input()
c=0
f=0
for i in range(len(s)):
    if s[i]==t[i]:
        c+=1
    else:
        print("NO")
        f=1
        break
if c==len(t)-1 and f==0:
    print("YES")
s = input()
t = input()

if t.startswith(s):
    print('YES')
else:
    print('NO')
s=input()
t=input()
if s in t:
    if len(s)+1==len(t):
        print("Yes")
    else:
        print("No")
else:
    print("No")
S = input()
T = input()
print("Yes" if S in T else "No")
S = input()
T = input()
j = 0
for i in T[0:len(S)-1]:
    if(i != S[j]):
        print('No')
        exit(0)
    j+=1
print('Yes')
s = input()
t = input()

one = s.islower() and t.islower()
two = 1 <= len(s) <= 10
three = len(t) == len(s) + 1
if one and two and three:
    print('Yes')
else:
    print('No')
S = input()
if S == "ABC":
  print ("ARC")
else:
  print("ABC")
S = input()
T = input()

if S == T[0:-1]:
    print("Yes")
first = input()
second = input()

if(second.find(first) >= 0):
  print("Yes")
else:
  print("No")
n=input()
m=input()
if len(n)+1==len(m) and n in m:
  print("Yes")
else:
  print("No")
s = str(input())
t = str(input())

ans = 'no'

if len(s) + 1 == len(t):
    i = 0
    for l in s:
        if l == t[i]:
            if len(s) == i + 1:
                ans = 'yes'
            i += 1
        else:
            break;

print(ans)
a=str(input())
b=str(input())
if a[0:-1]==b[0:-2]:
	print('Yes')
else:
	print('No')
# ABC167a


def main():
    import sys
    sys.setrecursionlimit(10**6)
    # 再帰関数を使わない限りPypyで出すこと

    def dump(*args):
        sys.stderr.write(str(args))

    s = input()
    t = input()
    if len(s) + 1 != len(t):
        print('No')
    if s != t[:-1]:
        print('No')
    print('Yes')


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

if t[0:len(s)] == s:
    print('yes')
else:
    print('no')
s = str(input())
t = str(input())

if t == s + t:
    print('Yes')
else:
    print('No')
s = input()
t = input()
if t[:-2] == s:
    print("Yes")
else:
    print("No")
s = input()
t = input()
print("Yes" if s in t and len(t)-len(s)==1 else "No")
import re
s=str(input())
t=str(input())
t2=s.replace(t[:-1],"",1)
if len(t2)==1 and re.sub(r"[a-z]","",t2)=="":
  print("Yes")
else:
  print("No")
a = input()
b = input()

if a.islower() | b.islower() == False:
	print("英小文字でありません")

if len(a) | len(b) >10:
	print("10文字以内でお願いします")

b1=list(b)
b1.pop(-1)
b2=""

for i in b1:
	b2 += i

if a == b2:
	print("Yes")

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

Slis = list(S)
Tlis = list(T)
Tlisremoved = Tlis.remove(Tlis[ - 1])
if Slis  ==Tlisremoved:
    print('Yes')
else:
     print('No')
s = input()
t = input()

if len(t) - len(s) == 1:
    if (t.find(s) == -1):
        print("No")
    else:
        print("Yes")
else:
    print('No')
s=str(input())
t=str(input())
num=0

if s == t[:-1]:
  print("yes")
else:
  print("no")
s = input()
t = input()
if len(t) == len(s)+1 and t[0:len(s)-1] == s:
  print("Yes")
else:
  print("No")
import re


S = input()
T = input()
S = S + r'.'
ans = 'No'
for i in T:
    if not i.islower():
        print(ans)
        exit(0)
if 1 <= len(T) <= 10:
    if re.match(S, T):
        ans = 'Yes'
print(ans)
s = input()
t = input()

if s == t[:-1]:
    print("yes")
else:
    print("no")
s = input()
t = input()

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

i = t.find(s)

if i==-1:
    print("No")
else:
    print("Yes")
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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

    if len(S) + 1 == len(T):
        print('yes')
    else:
        print('no')


if __name__ == '__main__':
    main()
s = str(input())
t = 's'+ str(input())

if(s for s in t):
    print('Yes')
else:
    print('No')
S=input()
T=input()

c=0
for i in S:
    if i in T:
        c+=1
if c==len(S):
    print("Yes")
else:
    print("NO")
in1 = input()
in2 = input()

if in2.islower() :
    if in1 in in2 :
        if len(in2) - len(in1) == 1 :
            print('Yes')
        else :
            print('No')
    else :
        print('No')
else :
    print('No')
s = input()
s1 = input()
if s in s1:
    print("YES")
else:
    print("NO")
s = input()
t = input()

ans = "Yes"
for i in range(len(s) - 1):
    if s[i] == t[i]:
        continue
    else:
        ans = "No"
if ans == "Yes" and (len(s)+1) == len(t):
    ans = "Yes"
else:
    ans = "No"

print(ans)
s = input()
t = input()
for i in range(len(s)):
    if s[i] != t[i]:
        print('no')
        break
    elif i == len(s)-1:
        print('yes')
def is_ID(a, b):
    if a==b[:-1]:
        print("Yes")
    else:
        print("No")
n =str(input())
r =str(input())

if  r in  n  :
    print('Yes')


else :
    print('No')
s = input()
t = input()
if 1 <= len(s) <= 10:
    if s in t:
        print("Yes")
    else:
        print("No")
else:
    print("No")
S = input()
T = input()
if T in S:
    print("Yes")
else:
    print("No")
s=input()
t=input()
print("Yes" if len(s)+1==len(t) else "No")
s = input()
t = input()
if s == t[:1]:
    if len(t) == len(s)+1:
        print('yes')
    else:
        print('No')
else:
    print('No')
s = input()
t = input()
print("Yes"if s in t else "No")
S = list(input())
T = list(input())
print(S)
print(T)
if len(S) + 1 == len(T):
    print('Yes')
else:
    print('No')
x=input()
y=input()
if x[:-1]==y[:-2]:
    print("Yes")
else:
    print("No")
s = input()
t = input()

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

if s == t[:(len(s))]:
  print("Yes")
else :
  print("No")
import re

a=input()
b=input()

if len(b)-len(a)==1:
    if re.search(a,b) is None:
        print("No")
    else:
        print("Yes")
else:
    print("No")
n = input()
N = input()
if n in N: 
    if len(n) == len(N) + 1: 
        print("Yes")
    else: 
        print("No")
else: 
  print("No")
# -*- coding: utf-8 -*-

list = []
for i in range(0, 2):
    val = input('')
    if val:
        list.append(val)
 
S = list[0]
T = list[1]

s = len(S)
t = len(T)

if t == s + 1:
    print('Yes')
else:
    print('No')
S=input()
T=input()
U=T[:len(T)-1]
print(U)
print("Yes" if(len(S)+1 == len(T) and S==U) else "No")
s = input()
t = input()
if len(t) == len(s)+1:
  if s.islower() == True and t.islower() == True:
  	print('Yes' if s[0:-1] == t[0:-2] else 'No')
  else:
    print('No')
else:
  print('No')
s=input()
t=input()
if s==t[:-1]:
    print("YES")
else:
    print("NO")
s=input()
t=input()[:-1]
if(s==t):
  print("yes")
else:
  print("no")
s = input()
t = input()

if len(s) + 1 != t:
    print("No")
    exit
elif s != t[:len(s)]:
    print("No")
    exit
else:
    print("Yes")
s,t = [str(input()) for _ in range(2)]
if s[:-1] == t:
	print('Yes')
else:
	print('No')
s=list(input())
t=list(input())
if s[0:-1]==t[0:-2] and len(s)+1==len(t) and t[-1].islower()==True:
  print('Yes')
  
else:
  print('No')
s = input()
t = input()

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

print(T)

if S == T:
    print("Yes")
else:
    print("No")
in1 = input()
in2 = input()
res = True

if len(in1) < 1 or len(in1) > 10 :
    res = False

if in1.islower() and in1.isalpha() :
    pass
else :
    res = False


if in2.islower() and in2.isalpha():
    if in1 in in2 :
        if len(in2) - len(in1) == 1 :
            pass
        else :
            res = False
    else :
        res = False
else :
    res = False

if res :
    print('Yes')
else :
    print('No')
s = input()
t = input()
print("YES" if t[:-1] == s else "NO")
S = input()
T = input()
if S in T and S != T:
    print('Yes')
else:
    print('No')
s = input()
t = input()

for i in range(len(s)):
  if s[i] != t[i]:
    print("No")
    exit()
print("yes")
######ANSDEFINE#######
no = "NO"

yes = "Yes"

#########END##########
S = input()
T = input()

sl = list(S)
tl = list(T)

Slen = len(S) + 1
Tlen = len(T)

if Slen == Tlen:
  if sl == tl[0:-1]:
    print(yes)
  else:
    print(no)
else:
  print(no)
def ABC_167_A():
    S = input()
    T = input()

    if T.count(S) == 1 and len(T) == len(S) +1 and T.index(S) == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':

    ABC_167_A()
s=input()
t=input()
if s in t:
	print("Yes")
else:
	print("No")
import re


S = input()
T = input()
S = S + r'.'
ans = 'No'
for i in T:
    if not i.islower():
        print(ans)
        exit(0)
if 1 <= len(S) <= 10:
    if re.fullmatch(S, T):
        ans = 'Yes'
print(ans)
s=input()
t=input()
if(len(t)==len(s)+1):
     if s in t:
          print("Yes")
     else:
          print("No")
else:
     print("No")
s=input()
t=input()
a="Yes"
for i in range(len(s)-1):
    if s[i]!=t[i]:
        a="No"
if len(s)+1!=len(t):
    a="No"
if len(s)>10 or len(s)<1:
    a="No"
if not (('a'<=s and s<='z') or ('a'<=t and t<='z')):
    a="No"
print(a)
n = input()
m = input()

if n == m[:-1]:
  print("Yes")
s=input()
t=input()
if (s in t) and len(t)==(len(s)+1):
	print("Yes")
else:
	print("No")
s = input()
t = input()
count = 0
for i in range(len(s)-1):
    if s[i] != t[i]:
        print('No')
        count = 1
if count != 1:
    print('Yes')
a = input().split()[0]
b = input().split()[0]
if a in b:
  print("Yes")
else:
  print("No")
a=input()
b=input()
if a in b:
    print("Yes")
else:
    print("No")
s=input()
y=input()
if (s==y[:-1]):
    print('Yes')
else:
    print('No)')
s = input()
t = input()
if len(t)-1 == len(s):
  if t.islower() == True:
  	print('Yes' if s[0:-1] == t[0:-2] else 'No')
  else:
    print('No')
else:
  print('No')
pattern=input()
target=input()


tmp = target.replace(pattern, '', 1)


if 1 == len(tmp):
    result = pattern + tmp
    
    if target == result:
        print('YES')
        exit()


print('NO')
s = input()
t = input()
 
if s in t and not t[1:] == s:
    print("Yes")
else:
    print("No")
a = input()
b = input()

if a in b and (len(a) + 1) == len(b) and b.islower() and a.islower():
  print("Yes")
else:
  print("No")
s = input()
t = input()
print('Yes' if t[:len(t)-2] == s else 'No')
S = input()
T = input()
print("Yes" if len(S)+1 == len(T) and S[-1]==T[-1] else "No")
s = input()
p = input()
if s in p:
    print("Yes")
else: print("No")
s=input()
s1=input()
if s==s1[:len(s1)-1]:
    print("YES")
else:
    print("NO")
a, b = input(), input()
if a==b[:len(a)]:
    print("Yes")
else:
    print("NO")
s =input()
t =input()

if s in t and len(t)==len(s)+1 and len(s)!=10 :
    print('Yes')
else:
    print('No')
S = input()
T = input()

T_plus = T[-1]
T_a = T[:-1]

print("Yes" if S==T else "No")
if __name__ == '__main__':
    a=input()
    b=input()
    if len(b)-len(a)==1:
        if b.find(a) !=-1:
            print("Yes")
    else:
        print("No")
s = input()
t = input()
ans='No'
if s in t and len(s) == len(t)-1: print("Yes")
else: print("No")
s = list(input())
t = list(input())
n = int(len(t))
m = int(len(s))
if s == t[0:n-2] and n-1 == m:
  print('Yes')
else:
  print('No')
S = input()
T = input()

if len(S) + 1 == len(T) and S == T[:-1] and 1 <= len(S) <= 10 and T.islower() == True and S.islower() == True:
    print("Yes")
else:
    print("NO")
s=input()
t=input()
if s==t[::1]:
  print("Yes")
else:
  print("No")
s = input()
t = input()
print("Yes" if s in t and len(t)-len(s) ==1 else "No")
s=str(input())
t=str(input())
if len(t)==len(s)+1:
	print('Yes')
else:
	print('No')
from sys import stdin

S = list(stdin.readline().rstrip())
T = list(stdin.readline().rstrip())

S[:len(S)]
T[:len(S)]

if S == T:
    print('No')
else:
    print('Yes')
daude = input()
daude1 = input()
if daude == daude[:-1]:
  print('Yes')
else:
  print('No')
a = input()
b = input()
if a == b[:-1]:
	print("YES")
else:
	print("NO")
s = str(input())
t = str(input())

if s.islower() and t.islower():
    if 1 <= int(len(s)) and int(len(s)) <= 10:
        if int(len(t)) == int(len(s)) + 1:
            if s in t:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
S = input()
T = input()

r = T.replace(S, '')

if len(r) == 1:
    print('Yes')
else:
    print('No')
S = input()
T = input()

print("YES" if T[:-1] == S else "NO")
#
from collections import Counter

k = input()


p = input()
p = p[0:len(p)-1]

if k==p:
    print('Yes')
s=input()
t=input()
for i in range(len(t)-1):
  T=""+t[i]
if T==s:
  print("Yes")
else:
  print("No")
n = input()
m = input()
m = list(m).pop()

if list(n) == m:
    print("Yes")
else:
    print("No")
s=input()
t=input()
print("yes" if s in t else "no")
S = input()
T = input()

if len(T) == 2 and T[0] == T[1]:
    print("YES")
else:
    T = T.replace(S,"")
    print(T)
    if len(T) == 1:
        print("YES")
    else:
        print("NO")
s = input()
t = input()
print('Yes' if s == t[:len(s)-1] else 'No')
s=input()
t=input()
a="Yes"
for i in range(len(s)-1):
    if s[i]!=t[i]:
        a="No"
if len(s)+1!=len(t):
    a="No"
if len(s)>10 or len(s)<1:
  a="No"
print(a)
# coding: utf-8
s1 = input()
s2 = input()
s2 = s2[-1]
print(s1, s2)

if s1 == s2:
    print("Yes")
else:
    print("No")
import re

s = input()
t = input()
a = t.replace(s, '')


if a.isalpha() and t != a:
    print('Yes')
else:
    print('No')
s = input()
t = input()

print(t[:len(s)])

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

if S in T:
    print('Yes')
else:
    print('No')
S = input()
T = input()

if ((S in T) and (len(S)+1 == len(T))):
    print("Yes")
else:
    print("No")
s,t = [str(input()) for _ in range(2)]
if s[:-1] == t and len(s) + 1 == len(t):
	print('Yes')
else:
	print('No')
n = input()
nn = input()
if n in nn:
  print("Yes")
else:
  print("No")
s=input().split()
t=input().split()
if(s==t[:-1]):
  print('Yes')
  exit(0)
print('No')
S = input()
T = input()
if S in T:
  print("Yes")
else:
  print("No")
s= str(input())
t= str(input())

r= str(t.replace(s, ''))
if len(r)==1 and t[0:len(s)]==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] and len(s)+1 == len(t) and 0 < len(s) < 11:
  print ('yes')
else:
  print ('no')
S=input()
T=input()
if T[0:len(T)-2]==S[0:len(S)-1]:
    print("Yes")
else:
    print("No")
def main():
    s = input()
    t = input()
    ans = "No"
    if len(t)-len(s) == 1:
        if s in t:
            ans = "Yes"
    print(ans)


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

N = len(S) - 1

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

SinT = T.startswith(S)

print(T[-1])
in1 = input()
in2 = input()
res = True

if len(in1) < 1 or len(in1) > 10 :
    res = False

if in2.islower() :
    if in1 in in2 :
        if len(in2) - len(in1) == 1 :
            pass
        else :
            res = False
    else :
        res = False
else :
    res = False

if res :
    print('Yes')
else :
    print('No')
s = input()
t = input()
if s in t:
    print('Yes')
else:
    print('No')
S = input()
T = input()
if S != T:
    print('Yes')
else:
    print('No')
A=input()
B=input()
if A in B:
    print("Yes")
else:
    print("No")
S = input()
T = input()

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

if s == t[0:-1]:
    
    print('Yes')
    
else:
    print('NO')
S = input()
T = input()
S = list(S)
T = list(T)
if S == T[:-1]:
    print(True)
else:
    print(False)
A=1
B=2
C=3
K=4
maxi=2*A-K+B
print(maxi)
s = str(input())
t = str(input())
if s.islower() and t.islower() and len(s)>=1:
    new_t = t[:(len(t)-1)]
    print(s,t)
    if (s==new_t):
        print("Yes")
    else:
        print("NO")
a=input()
b=input()
if(a in b):
  print("Yes");
else:
  print("No");
def problem1(S,T):
    s = len(S)
    t = len(T)
    if( 1 <= s <=10 and t == (s+1)  ):
        for i in range(s):
            if(S[i] == T[i]):
                return("Yes")
            else:
                return("No")
        else:
            return("No")
    else:
        return("No")
def ABC_167_A():
    S = input()
    T = input()

    if T.count(S) == 1 and len(T) == len(S) +1:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':

    ABC_167_A()
S = list(input())
T = list(input())
t = []
s = len(S)
for i in range(s):
    t += T[i]
if t == S:
    print("yes")
else:
    print("No")
S = input()
T = input()

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

S = input()
T = input()

if(S==T[:-1] and len(T) == len(S)+1):
    print("yes")
else:
    print("no")
S = input()
T = input()
cond = (1 <= len(S) and len(S) <= 10) and S[:-1] == T[:-1]
print('Yes' if cond else 'No')
x = input()
y = input()
if x in y:
    print("Yes")
else:
    print("No")
import re

s = input()
t = input()

if s in t and re.search(r'[a-z]',t[-1]):
  print("Yes")
else:
  print("No")
n =str(input())
r =str(input())
s = len(r)
if  n== r[0:s]  :
    print('Yes')
else :
    print('No')
# @author 

import sys

class ARegistration:
    def solve(self, tc=0):
        s = input()
        t = input()
        print("Yes" if t[:-1] == s else "No")


solver = ARegistration()
input = sys.stdin.readline

solver.solve()
S=input()
T=input()
L=len(S)
if(S[:L-1] == T[:L-1]):
	print("Yes")
else:
	print("No")
import numpy as np

s = list(input())
t = list(input())

if len(s)+1 == len(t):
    for i in range(len(s)):
        if s[i] == t[i]:
            continue
        else:
            print("No")
            break
    if i == len(s)-1:
        print("Yes")
else:
    print("No")
# @author 

import sys

class ARegistration:
    def solve(self, tc=0):
        s = input()
        t = input()
        print("Yes" if t.startswith(s) and len(t) == len(s) + 1 else "No")


solver = ARegistration()
input = sys.stdin.readline

solver.solve()
if __name__ == '__main__':
    S = input()
    T = input()


    if S == T[:len(S)]:
        print('True')
    else:
        print('False')
old = str(input('古いパスワードは？'))
new = str(input('新しいパスワードは？'))

if old == new[:-1]:
    print('yes')

elif not old == new[:-1]:
    print('no')
s=input()
t=input()
if len(s)+1==len(t) and t.find(s)==0:print("YES")
else:print("NO")
n = input()
m = input()
m = list(m).pop()

if list(n) == list(m):
    print("Yes")
else:
    print("No")
s=input()
t=input()
a=s.islower()
b=t.islower()
m=s[0:-1]
if (m!=s):
 print("No")
elif (a==0 or b==0):
 print("No")
else:
 print("Yes")
s=str(input())
t=str(input())
s=str(s+s[-1])
if s==t :
	print('Yes')
else:
	print('No')
s=input()
t=input()

if s in t:
  print("Yes")
else:
  print("No")
s=input()
t=input()
t=t[:-1]
print(s)
if s==t:
    print("Yes")
else:
    print("No")
s = input()
t = input()
 
if (s in t) or (t[:1] == s):
    print("Yes")
else:
    print("No")
a=input()
b = input()
for i in range(len(a)-1):
    if a[i] != b[i]:
        print('No')
        exit()
print('Yes')
s = input()
t = input()

if len(t) - 1 == len(s):
    print("Yes")
else:
    print("No")
n = list(map(str,input().lower()))
m = list(map(str,input().lower()))
# n = str(input())
# m = str(input())
if (n[:] == m[:-1]) and (len(m) == len(n)+1):
    print('yes')
else:
    print('No')
S, T = input(), input()

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

T2 = T.rstrip()

if S == T2:
  print('Yes')
else:
  print('No')
s =input()
t =input()

if t[0:len(s)]==s and  0<=len(s)<=9 and len(t)==len(s)+1 and s in t:
    
    print('Yes')
else:
    print('No')
flag = True
s = [input() for i in range(2)]
if (len(s[0]) > 10 or len(s[0]) < 1) or (len(s[0]) + 1 != len(s[1])):
    flag = False
else:
    for j in range(len(s[0])):
        if not s[0][j] == s[1][j]:
            flag = False
if flag:
    print("yes")
s = input()
t = input()

if (t.count(s) > 0):
    print("Yes")
else:
    print("No")
S=input()
T=input()
if T[:0] == S:
    print("Yes")
else:
    print("No")
S = input()

T = input()

alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

for i in alpha:
  if T == S + i:
    print("YES")
  else:
    print("NO")
s = input()
t = input()
if (s in t):
    if (len(t)-len(s)==1):
        print("Yes")
else:
    print("No")
s=input()
t=input()

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

a=0
for i in range(len(S)):
    if len(T)==len(S)+1:
        if S[i]==T[i]:
            a=1
        else:
            print('No')
            break
    else:
        print('No')
        break
if a==1:
    print('Yes')
S=input()
T=input()

a=1
if len(T)==len(S)+1:
    for i in range(len(S)):
        if S[i]==T[i]:
            if a==0:
                break
            a=1
        else:
            a=0
            print('No')
            break
else:
    print('No')
S = list(input())
T = list(input())

def list_difference(list1, list2):
    result = list1.copy()
    for value in list2:
        if value in result:
            result.remove(value)
    return result

result = list_difference(T, S)

#print(result)
if(len(result) == 1):
    print("Yes")
else:
    print("No")
n = input()
m = input()
m = list(m).pop()
m = "".join(m)
if n == m:
    print("Yes")
else:
    print("No")
s = input()
t = input()

if s in t:
	print("Yes")
else:
	print("No")
S = input()
T = input()
if S == T[:-1] and len(S)==len(T)+1:
  print('Yes')
else:
  print('No')
a=input()
b=input()
if(len(b)==len(a)+1 and b[:-2]==a):
  print("Yes")
else:
  print("No")
S = str(input())
T = str(input())
if S in T:
  print("Yes")
else:
  print("No")
S = input()
T = input()
if T[:-1]==S:
    print("YES")
else:
    print("NO")
s=input()
t=input()
c=0
f=0
if len(t)!=(len(s)+1):
    print("NO")
    f=1
    
for i in range(len(s)):
    if s[i]==t[i]:
        c+=1
    elif s[i] != t[i]:
        print("NO")
        f=1
        break
    elif len(t)!=len(s)+1:
        print("NO")
        f=1
        break
if c==len(t)-1 and f==0:
    print("YES")
s = input()
t = input()

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

print(S)
print(T)

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

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

if len(S) == len(T)+1:
    print('Yes')
else:
    print('No')
S = input()
T = input()

def register(S, T):

    if 1 <= len(S) <= 10 and len(T) == len(S) + 1:
        print ("Yes")
    else:
        print("No")
         
register(S, T)
s=input()
t=input()
if s[1:len(s)]==t[1:len(s)]:
    print('Yes')
else:
    print('No')
n = str(input())
m = str(input())
if (n[:] == m[:-1]) and (len(m) == len(n)+1):
    print('yes')
else:
    print('No')
s = input()
t = input()
if len(s)+1 == len(t):
  print("Yes")
else:
  print("No")
n = input()
N = input()
if n in N:
    print("YES")
else:
    print("NO")
s = str(input())
t = str(input())
if (s.islower() and t.islower() and (len(s)>=1) and (len(s)<=10) and len(t)==(len(s)+1)):
    # print("s",s,"t",t,"len(s)",len(s),"len(t)",len(t))
    new_t = t[:(len(t)-1):1]
    # print("new_t",new_t)
    if (s==new_t):
        print("Yes")
    else:
        print("NO")
s=input()
t=input()

if s==t[0:-1]:
    print("YES")
else:
    print("NO")
from sys import stdin

S = list(stdin.readline().rstrip())
T = list(stdin.readline().rstrip())

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

if(s==r):
  print("Yes")
S = input()
T = input()
if S + 'z' == T :
    print('Yes')
else :
    print('No')
if __name__ == '__main__':
    a=input()
    b=input()
    if len(b)-len(a)==1:
        if a in b:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
S = input()
T = input()

if (len(T) == len(S)+1) and (S in T):
  print("Yes")
else:
  print("No")
S = input()
T = input()
 
if S == T[:-1]:
    print("YES")
else:
    print("NO")
S = input()
T = input()
l = len(S)
if S == T[:-1] and l<=10 and l>=1 and S.islower():
    print(True)
else:
    print(False)
S=input()
T=input()

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