peterverebics/CodeNet_Python_118 huggingface dataset:
def main():
	s = input().strip()
	t = input().strip()

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

main()
S = input()
T = input()

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

S = input()
T = input()
cut_T = (T[:-1])
if S == cut_T and 1<=len(S)<=10:
    print('Yes')
else:
    print('No')
S = input()
T = input()
num = len(S)
if S == T[0:num]:
  print('Yes')
else:
  print('No')
S = input()
T = input()

count = 0
for i in range(len(S)):
    if S[i] == T[i]:
        count += 1

if count == len(S):
    print('Yes')
else:
    print('No')
s = input()
t = input()
flag = True
for i in range(len(s)):
    if s[i] != t[i]:
        flag = False
if flag:
    print("Yes")
else:
    print("No")
s = input()
t = input()
if t[:-1] == s:
  print('Yes')
else:
  print('No')
s = input()
t = input()
if t.startswith(s) == 1:
    print("Yes")
else:
    print("No")
n = input()
m = input()

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

print('Yes' if T[0 : len(S)] == S else 'No')
# -*- coding: utf-8 -*-

list = []
for _ in range(2):
    list.append(input())

S = list[0]
T = list[1]

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


if t == s + 1 and S == T[: -1]:
    print('Yes')
else:
    print('No')
s=input()
t=input()
flag = (len(s)+1==len(t))
for i in range(len(s)):
    if s[i]!=t[i]:
        flag = False
ans = "Yes" if flag else "No"
print(ans)
# 2020/05/10
# AtCoder Beginner Contest 167 - A

# Input
s = input()
t = input()

# Calc
wt = s + t[len(t)-1]
if wt == t:
    ans = 'Yes'
else:
    ans = 'No'

# Output
print(ans)
S = input()
T = input()
flag = 0
for i in range(len(S)):
    if S[i] != T[i]:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")
S = input()
T = input()
N = len(S)
flag = 0
for i in range(N):
    if S[i] != T[i]:
        flag = 1
print("No" if flag == 1 else "Yes")
a = input()
b = input()

if a == b[:-1]:
  print('Yes')
else:
  print('No')
s=input()
t=input()
alphabet='abcdefghijklmnopqrstuvwxyz'
answer='No'
for i in range(26):
    if t==s+alphabet[i]:
        answer='Yes'
        break
print(answer)
S = input()
T = input()
flag=0

#if len(S)+1 == len(T):
if S == T[:-1]:
    flag=1
        
    
if flag==1:
    print("Yes")
else:
    print("No")
s=input()
t=input()
T=""
for i in range(len(t)-1):
  T=T+t[i]
if T==s:
  print("Yes")
else:
  print("No")
s=input()
t=input()
if len(t)==len(s)+1 and t[0:len(s)]==s:
    print("Yes")
else:
    print("No")
def main():
    S = input()
    T = input()

    J = True

    for i in range(len(S)):
        if S[i] != T[i]:
            J = False


    if J:
        print("Yes")

    else:
        print("No")


if __name__ == '__main__':
    main()
s=input()
t=input()
print('Yes' if t[:len(s)]==s else 'No')
s=str(input())
t = str(input())
if(s==t[0:len(s)]):
  if(len(s)+1==len(t)):
    print("Yes")
  else:
    print("No")
else:
  print("No")
import sys

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

input_s = S()
t = S()

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

T2 = T[:-1]

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

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

if s == t[:len(t)-1]:
    print('Yes')
else:
    print('No')
s=input()
t=input()
if(s[0:]==t[0:len(s)]):
    print('Yes')
else:
    print('No')
I = [input() for i in range(2)] 
S = I[0]
T = I[1]
L = len(T)
S2 = T[:L-1]
if S2 == S :
    ans = 'Yes'
else :
    ans = 'No'
print(ans)
S = str(input())
T = str(input())
if T[:len(T)-1]==S and len(T)-len(S)==1:
	print("Yes")
else:
	print("No")
def main():
    S = input()
    T = input()
    if S == T[:-1]:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
import sys
s, t = (line.strip() for line in sys.stdin)
print("Yes" if t.startswith(s) else "No")
a = input()
b = input()
if a == b[:-1] and len(a) + 1 == len(b):
  print("Yes")
else:
  print("No")
s=input()
t=input()

n=len(s)
n2=len(t)
sum=0
if n2-n==1:
    for i in range(n):
        if s[i]==t[i]:
            sum+=1
    if sum==n:
        print("Yes")
    else:
        print("No")
else:
    print("No")
S = input()
T = input()
if(T[0:len(T)-1] == S):
    print("Yes")
else:
    print("No")
S = input()
T = input()
print('Yes' if S == T[:len(S)] else 'No')
s=[input() for i in range(2)]
n=len(s[0])

if s[0][0:n]==s[1][0:n]:
  print("Yes")
else:
  print("No")
x=input()
y=input()
if x==y[:-1]:
    print("Yes")
else:
    print("No")
def main():
    s = input()
    t = input()
    if s == t[:-1]:
        print("Yes")
    else:
        print("No")
    

if __name__ == "__main__":
    main()
import sys
#入力する名前S
S = input()

#新しいID T
T = input()

#print(S)
#print(type(S))
#print(T)
#print(type(T))

if S == T[:-1]:
    print("Yes")
    sys.exit()

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

if (len(T) == len(S) +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())

if all(S[i]==T[i] for i in range(len(S))) and (len(T)==len(S)+1):
    print("Yes")

else:
    print("No")
s=input()
t=input()
print('Yes') if s+t[-1]==t 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(s) == len(t)-1) and (s == t[:len(t)-1]):
    print("Yes")
else:
    print('No')
S = input()
T = input()

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

if s+1 == t:
    for i in range(s):
        if S[i] != T[i]:
            print("No")
            break
    else:
        print("Yes")
else:
    print("No")
def main():
    s = input().rstrip()
    t = input().rstrip()

    s_len = len(s)
    t_len = len(t)
    if s_len+1 == t_len and s == t[:s_len]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
s = input()
t = input()
n = len(s)
for i in range(n):
    if (s[i] == t[i]) and (len(s)+1==len(t)):
      continue
    else:
        print('No')
        exit()
print('Yes')
A = input()
B = input()
print('Yes' if A == B[:len(B)-1] else 'No')
s = input()
t = input()

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

s_length = len(s)
t_length = len(t)

if t[:t_length-1] == s and t_length - s_length == 1:
    print("Yes")
else:
    print("No")
s = input()
t = input()
l = len(s)
for i in range(l):
    if s[i] == t[i]:
        pass
    else:
        print('No')
        exit()

print('Yes')
s1 = input()
s2 = input()

def check(s1,s2):
    if len(s1)+1 != len(s2):
        print('No')
        return 
    
    for i in range(len(s1)):
        if s1[i] != s2[i]:
            print('No')  
            # print(s1[i],s2[i])  
            return
    print('Yes')    

check(s1,s2)
S = input()
T = input()

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

a=0
x="abcdefghijklmnopqrstuvwxyz"
for i in range(26):
    if S+x[i]==T:
        a+=1

if a==1:
    print("Yes")
else:
    print("No")
s = input()
t = input()

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

ans = "Yes" if s == t[:-1] else "No"
print(ans)
s = input()+str(1)
t = input()
i = 0
n = len(s)-1

while s[i]==t[i] and i < n:
  i += 1

if i == n:
  print("Yes")
else:
  print("No")
s=input()
t=input()
if s==t[:-1]:
  print('Yes')
else:
  print('No')
import sys

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

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


if __name__ == "__main__":
    main()
    sys.exit(0)
import sys
s, t = [line.rstrip("\n") for line in sys.stdin.readlines()]
if s == t[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()

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

if s.islower() and s.isalpha() and t.islower() and t.isalpha() and 1<=len(s)<=10:
    a = t[:-1]
    #print(a)
    if s==a:
        print("Yes")
    else:
        print("No")
else:
    print("No")
def main():
    S = input()
    T = input()

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

if __name__ == "__main__":
    main()
S=input()
T=input()
l=len(S)
t=T[0:l]
if t==S:
    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()
print("Yes")
s = input()
T = input()

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

if len(T)-1 == len(S):
  isSame = True
  for i in range(len(S)):
    if S[i]!=T[i]:
      isSame = False
      break
  if isSame == True:
    print('Yes')
  else:
    print('No')
else:
  print('No')
s=list(input())
t=list(input())
for i in range(len(s)):
	if not s[i]==t[i]:
		print("No")
		break
	elif i ==len(s)-1:
		print("Yes")
S = input()
T = input()

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

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

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

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

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

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

ans = True
for i in range(len(s)):
    if s[i] != t[i]:
        ans = False

if ans:
    print("Yes")
else:
    print("No")
a=list(input())
b=list(input())
if a==b[:len(b)-1]:
    print('Yes')
else:
    print('No')
def resolve():
    S = input()
    T = input()
    for s, t in zip(S, T):
        if s != t:
            print("No")
            return
    print("Yes")

if __name__ == "__main__":
    resolve()
import math

def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

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()
for i in range(len(S)):
    if S[i]!=T[i]:
        print("No")
        exit()
if len(S)==len(T)-1:
    print("Yes")
S = input()
T = input()

if 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 s == t[:-1]:
  print("Yes")
else:
  print("No")
S=input()
T=input()
print("Yes" if S==T[:len(S)] else "No")
s=input()
t=input()
if t[:len(s):]==s:
    print("Yes")
else :
    print("No")
S = input()
T = input()
if S == T[:-1]:
    print ('Yes')
else:
    print('No')
s = [i for i in input()]
t = [i for i in 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()
l = len(t)-1
print('Yes') if s == t[:l] else print('No')
S=list(input())
T=list(input())
del T[-1]
if S==T:
  print("Yes")
else:
  print("No")
# coding: utf-8
# Your code here!

S = input().rstrip()
T = input().rstrip()

T1 = list(T)
T1.pop()
#print(T1)
S1 = list(S)
T1= list(T1)
#print(S1)
#print(T1)
#print(T1)
#print(S1)
if T1 == S1:
    print("Yes")
else:
    print("No")
s=input()
t=input()
if t[0:len(t)-1]==s:
    print('Yes')
else:
    print('No')
def main():

    s=list(input())
    t=list(input())
    flg=True
    for i in range(len(s)):
        if s[i]!=t[i]:
            flg=False

    if flg==True and (len(s)+1)==len(t):
        print('Yes')
    else:
        print('No')

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

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

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

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

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

if a == b[:-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[:-1] == S):
  print("Yes")
else:
  print("No")
s=input()
t=input()
count=0

for i in range(len(s)):
    if s[i]!=t[i]:
        count+=1
if count==0:
    print("Yes")

else:
    print("No")
import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0
s = input()
t = input()
if len(t)-len(s) == 1:
    if s == t[:-1]:
        py()
    else:
        pn()
else:
    pn()
s = input()
t = input()
if s == t[:-1] :
    print("Yes")

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

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

if (T.startswith(S) and
    len(S) + 1 == len(T)):
  print("Yes")
else:
  print("No")
S=input()
T=input()
print('Yes') if S==T[:-1] else print("No")
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do(): 
    s=STR()
    t=STR()
    ls=len(s)
    lt=len(t)
    flg=1
    if ls+1!=lt:
        flg=0
    if s!=t[0:ls]:
        flg=0
    if flg==1:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()
S = input()
T = input()
if S == T[:len(S)] and len(T) == (len(S) + 1):
    print('Yes')
else:
    print('No')
s=list(input())
t=list(input())
print("Yes"if all(s[i]==t[i] for i in range(len(s))) else "No")
S = input()
T = input()

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

if flag != 1:
    print("Yes")
S=input()
T=input()

if T.startswith(S) and len(S) + 1 == len(T):
    print('Yes')
else:
    print('No')
S = str(input())
T = str(input())
if S == T[:-1]:
    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')
def solution():
    s = input()
    t = input()

    if t.startswith(s) and 1 == (len(t) - len(s)):
        print('Yes')
    else:
        print('No')

solution()
S=input()
T=input()

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

S = input()
T = input()

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

if t[0:-1]==s:
    print("Yes")
else:
    print("No")
s = input()
t = input()
b = True
for i in range(len(s)):
    if s[i] != t[i]:
        b = False
if b:
    print('Yes')
else:
    print('No')
s=input()
t=input()
if(len(t)!=len(s)+1):
    print("No")
else:
    flag=1
    for i in range(len(s)):
        if(s[i]!=t[i]):
            print('No')
            flag=0
            break
    if(flag==1):
        print('Yes')
S = input()
T = input()

if S == T[:len(T)-1]:
    print('Yes')
else:
    print('No')
S = input()
T = input()
s = len(S)
for i in range(s):
    if S[i] == T[i]:
        continue
    else:
        print('No')
        exit()
print("Yes")
S=input()
T=input()
answer=0
for a in range(len(S)):
    if S[a]==T[a]:
        answer+=1
if answer==len(S):
    print('Yes')
else:
    print('No')
import numpy as np
import math
from collections import Counter

s = input()
t = input()

if s == t[:-1]:
    print("Yes")
else:
    print("No")
S = input()
T = input()
if T[0:len(S)] == S and len(S) + 1 == len(T):
  print("Yes")
else:
  print("No")
#print(S,T)
s = input()
t = input()
if len(s)+1 == len(t) and t.startswith(s):
  print('Yes')
else:
  print('No')
s = list(input())
t = list(input())
m = t.pop()
if s == t:
    print('Yes')
else:
    print('No')
S=input()
T=input()
if T[:-1]==S:
    print("Yes")
else:
    print("No")
input_line=input()
input_line2=input()
input_line2=(input_line2[0:-1])
if input_line == input_line2:
	print ("Yes")
else:
	print ("No")
s = str(input())
t = str(input())

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

for i in range(len(S)):
  if S[i] == T[i]:
    judge = "Yes"
  else:
    judge = "No"
    break
    
print(judge)
S = input()
T = input()[:-1]

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

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

T = T[:-1]

if S == T:
  print("Yes")
else:
  print("No")
s = list(input())
t = list(input())
for i in range(len(s)):
    if s[i] != t[i]:
        print("No")
        exit()

print("Yes")
def read_int():
    return int(input())

def read_int_map():
    return map(int,input().split(' '))

def read_int_list():
    return list(map(int,input().split(' ')))

def read_s_list_loop(n):
    return [input() for _ in range(n)]

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

if (T[:-1] == S) and (len(S) + 1 == len(T)):
  print("Yes")
else:
  print("No")
# デバッグ用
GBN_DEBUG = False
#GBN_DEBUG = True
def dprn(s, i):
    if GBN_DEBUG: print(", " + s + " = " + str(i), end = "")
def dprns(s):
    if GBN_DEBUG: print(", " + s, end = "")
def dprni(i):
    if GBN_DEBUG: print(i, end=" ")
def endl(): 
    if GBN_DEBUG: print('')

#本体ここから
s = input()
t = input()

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

S = input()
T = input()

if len(T) - len(S) != 1:
  print('No')
  sys.exit()

for i in range(len(S)):
  if S[i] != T[i]:
    print('No')
    sys.exit()

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

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)


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

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

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

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

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

if 1 <= len(s) <= 10 and s.islower() is True  and t.islower() is True and s + t[-1] == t:
    print('Yes')

else:
    print('No')
S=list(input())
T=list(input())
T.pop(len(T)-1)
if S == T:
	print("Yes")
else:
	print("No")
s = input()
t = input()
n = len(s)
a = t[0:n]
if a == s: print("Yes")
else: print("No")
import sys
readline = sys.stdin.readline

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

print(("No","Yes")[S == T[:-1]])
def resolve():
    S = str(input())
    T = str(input())
    if T[:-1] == S:
        print('Yes')
        return
    print('No')
    return

resolve()
S = input()
T = input()

if S == T[:len(T)-1] and len(S) + 1 == len(T):
    print("Yes")
else:
    print("No")
s=input()
t=input()
if t[:len(s)]==s:
    print('Yes')
else:
    print('No')
S = input()
T = input()
print(['No','Yes'][S == T[:-1]])
s = input()
t = input()
t = t[:-1]
if s == t:
  print("Yes")
else:
  print("No")
s = input()
t = input()
if(s == t[0:len(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 t[:-1] == s:
    print('Yes')
else:
    print('No')
S = input()
T = input()

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

n=len(s)
if s==t[:len(s)]:
    print('Yes')
else:
    print('No')
def resolve():
    s = str(input())
    t = str(input())
    if 1 <= len(s) <= 10 and s + t[-1] == t:
        print('Yes')
    else:
        print('No')


resolve()
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353





S = sys.stdin.buffer.readline().decode().rstrip()
T = sys.stdin.buffer.readline().decode().rstrip()
ok = T[:-1] == S
if ok:
    print('Yes')
else:
    print('No')
def main():
    s = input()
    t = input()
    for i in range(len(s)):
        if s[i] != t[i]:
            print("No")
            return

    print("Yes")
    return


if __name__ == "__main__":
    main()
S = input()
T = input()
length = len(T)
T1= T[0:length-1]
if T1 == S:
    print('Yes')
else:
    print('No')
s = input()
t = input()

ans = "No"
if s == t[:len(t) - 1]:
    ans = "Yes"

print(ans)
# 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')
        exit(0)
    if s != t[:-1]:
        print('No')
        exit(0)
    print('Yes')


if __name__ == '__main__':
    main()
def main():
    s = input()
    t = input()
    t_ = t[:len(t)-1]
    if s == t_:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()
def main():
    s = input()
    t = input()
    if len(s)+1 == len(t) and s == t[:-1]:
        print("Yes")
    else:
        print("No")

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

if S == T[:len(S)] and len(T) == len(S) + 1:
    print('Yes')
else:
    print('No')
"""
"""
S = input()
T = input()
s_l = list(T)
del s_l[-1]
check = ''.join(s_l)
print('Yes' if check == S else 'No')
S = input()
T = input()

if S == T[:-1]:
  print("Yes")
else:
  print("No")
s=input()
t=input()[:-1]
print('YNeos'[s!=t[:len(t)]::2])
s,t=input(),input()
print("Yes" if s==t[0:-1] else "No")
s = input()
t = input()
if len(s) <= 10:
    if len(s)+1 == len(t):
        if s == t[:-1]:
            print("Yes")
            exit()
print("No")
S = input()
T = input()

T2 = T[:-1]

if S == T2:
  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(T)-1]:
    print("Yes")
else:
    print("No")
s = input()
t = input()
if (s == t[0:len(s)]) and ((len(s)+1) == len(t)):
  print("Yes")
else:
  print("No")
s = input()
t = input()[:-1]
if s == t:
  print('Yes')
else:
  print('No')
s = input()
t = input()

t = t[:-1]

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

if S == T:
  print("Yes")
else:
  print("No")