peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
t = input()
ls= list(s)
lt = list(t)
if len(ls)+1 == len(lt) :
    print("Yes")
else:
    print("No")
s = input()
t = input()
t2 =t.strip(t[-1])
if(t2 == s):
    print("Yes")
else:
    print("No")
S=input()
T=input()
if T.startswith(S):
    if len(T)==len(S)+1:
        print('YES')
else:
    print('NO')
a = input()
b = input()

if a in b and (len(a) + 1) == len(b) and b.islower():
  print("Yes")
else:
  print("No")
def solve():
    s = input()
    t = input()
    a = len(s)
    b = len(t)
    if b > a +1:
        print("NO")
    elif t > s:
        print("Yes")
    else:
        print("No")
    

if __name__ == '__main__':
    solve()
s = input()
t = input()
a_1 = len(s)
a_2 = len(t)
if a_1+1 == a_2:
    for i in range(a_1):
        if s[i] != t[i]:
            ans = "No"
        else:
            ans = "Yes"
else :
    ans = "No"
print(ans)
s= str(input())
t = str(input())
s = list(s)
t = list(t)
a=0
for i in range(len(s)-1):
            if s[i]==t[i]:
               a = a+1
if a == len(s)-1:
    if len(t)-len(s)==1:
        print("Yes")
    else:
        print("No")
else:
    print("No")
S=input()
T=input()
l=len(S)
if S==T[:-1] and S.islower()==True and 1<=l and l<=10:
  print("Yes")
else:
  print("NO")
S = input()
T = input()
if S in T and S != T and len(T) == len(S) + 1:
    print('Yes')
else:
    print('No')
a=input()
b=input()
if a in b:
  if a[0]==b[0]:
    print("Yes")
  else:
    print("No")
A = list(input())
B = list(input())
c = len(B)
del B[c-1]
if A == B:
  print("Yes")
else:
  print("NO")
s = input()
t = input()

if len(s) >= 1 and len(s) <= 10 and len(t) == len(s) + 1:
  print("Yes")
else:
  print("No")
s = str(input())
t = str(input())
lens = len(s)
lent = len(t)

if lens < 1 or lens > 10 or (lent != lens + 1) or (s not in t):
    print('No')
else:
    print('Yes')
s = input()
t = input()
if s == t[:-1]:
  print("YES")
else: 
  print("NO")
S = input(">>")
T = input(">>")
 
a = 0
flag1 = False
flag2 = False

if (len(T) - len(S) == 1):
    flag1 = True

if (S == T[:-1]):
    flag2 = True

if (flag1 and flag2):
    print("Yes")
else:
    print("No")
s=input()
t=input()
if len(s) > 10 or len(t) == len(s) + 1:
  if t[:-1] == s:
    print("Yes")
else:
  print("No")
S = input()
T = input()

if S in T:
    print("Yes")
else: print("No")
s=input()
t=input()
n=0
if(len(t)==len(s)+1):
  for i in range(0,len(s)):
    if(s[i]==t[i]):
      n=n+1
if(n==len(s)):
  print("Yes")
else:
  print("Np")
# coding: utf-8
s1 = input()
s2 = input()
s2 = s2[-1]

if s1 == s2:
    print("Yes")
else:
    print("No")
S=input()
T=input()
num=0
for i in range(len(S)):
    if S[i]==T[i]:
        num+=1
    else:
        print("No")
if num==len(S):
    print("Yes")
else:
    print("No")
str1 = input()
str2 = input()

alpha = str2[len(str1):]

if len(alpha) == 1 and alpha.isalpha():
  print("Yes")
else:
  print("No")
s=list(input())
t=list(input())
if s==t[:len(s)]:
    print("Yse")
else:
    print("No")
import sys

print("Enter ID")
str_1 = input()
str_2 = input()

if not str_2.startswith(str_1,0):
    print("No")
    sys.exit()

if len(str_1) + 1 != len(str_2):
    print("No")
    sys.exit()

print("Yes")
n =str(input())
r =str(input())
s = len(n)
if  n== r[0:s+1]  :
    print('Yes')
else :
    print('No')
S = str(input())
T = str(input())
if S[-1] == "e":
    if T[-1] != "e":
        print("Yes")
    else:
        print("No")

else:
    print("Yes")
S = str(input())
T = str(input())
if len(T) == len(S) + 1:
    print("Yes")
else:
    print("No")
S=input()
T=input()
if(str.isalpha(S)==1 and len(S)>=1 and len(S)<=10 and len(T)==len(S)+1):
    print('Yes')
else:
    print('No')
s = list(input().split())
t = list(input().split())
del t[-1]

if s == t:
    print("Yes")
else:
    print("No")
s=input()
t=input()
if s in t:
  print("Yes")
else:
  print("No")
from copy import copy, deepcopy
from collections import Counter
from math import sqrt, floor, factorial
from itertools import permutations, combinations, combinations_with_replacement
from operator import mul
from functools import reduce
import bisect

MOD = 10**9 + 7
INF = float('inf')

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

if s in t and length_s + 1 == length_t:
  print("Yes")
else:
  print("No")
S=input()
T=input()

print("Yes" if S+T[-1]==T else "NG")
s = input()
t = input()
if 1 <= len(s) <= 10:
    if s in t and len(s) + 1 == len(t):
        print("Yes")
    else:
        print("No")
else:
    print("No")
s=input()
t=input()
if s in t:
    print("Yes")
else:
    print("No")
S=str(input())
T=str(input())
if len(S)==1 and S[0]==T[0] and len(T)==2:
  print('Yes')
elif len(T.replace(S,''))==1:
  print('Yes')
else:
  print('No')
S=input()
T=input()
T=T[:-1]
c=0
for i in S:
    if i in T:
        c+=1
if c==len(S):
    print("Yes")
else:
    print("NO")
s= str(input())
t= str(input())

if len(t) == len(s) + 1 and len(s) >=1 and len(s) <= 10 and s.islower() and t.islower():
  for i in range(len(s)):
    if s[i]!=t[i]:
      print("No")
      break
  print("Yes")
else:
  print("No")
S = input()
T = input()

T = T.replace(S,"")
print(T)
if len(T) == 1:
    print("YES")
else:
    print("NO")
S = input()
T = input()
if S in T:
    print('Yes')
else:
    print('No')
S = input()
T = input()

Slis = list(S)
Tlis = list(T)
Tlis.remove(Tlis[ - 1])
if len(S) == 0:
    print('No')
elif Slis  == Tlis:
    print('Yes')
else:
    print('No')
import sys
import math
from functools import reduce
from operator import mul
sys.setrecursionlimit(10**6)

def InMap(): return list(map(int, sys.stdin.readline().split(' ')))
def In(): return int(sys.stdin.readline())
def InS(): return sys.stdin.readline()

S = InS()
T = InS()

if S[:-2:] == T[:-3:]:
    print("Yes")
else:
    print("No")
c1 = input()
c2 = input()

if c1 == c2[:-1]:
    print('YES')
else:
    print('NO')
st = input()
st2 = input()
f = st2[len(st2)-1]
lst = []
lst2 = []
for i in st:
  lst.append(i)
for i in st2:
  lst2.append(i)
lst2.remove(f)
yo = "Yes"
for i in range(len(st)):
  if lst[i] != lst2[i] or len(lst)+1!=len(lst2):
    yo = "No"
print(yo)
s,t=input(),input()
if len(t)-len(s)==1:print("Yes")
else:print("No")
s =input()
t = list(input())
t.remove(t[-1])

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

if len(S) < 1:
    print("NO")
elif len(S) > 10:
    print("NO")
elif T[:-1] != S:
    print("NO")
elif set(T) - set("abcdefghijklmnopqrstuvwxyz"):
    print("NO")
else:
    print("Yes")
s = input()
t = input()

if s == t[:-1]:
    print('yes')
else:
    print('no')
import re

input_line = input()
s = input()

content = s.replace(input_line, '', 1)
#print(content)

pattern = '^\w$'

# compile後match
try:
    repatter = re.compile(pattern)
    result = repatter.match(content)
    result.group()
    print ('Yes')
except:
    print ('No')
A = input()
B = input()
 
if (A in B) and (len(B)-len(A)==1) and (1<=len(A)<=10) and (A.islower()) and (B.islower()):
  print("Yes")
else:
  print("No")
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline



def acinput():
    return list(map(int, input().split(" ")))


S=input()
T=input()

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

print(T[:-1])
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()
if len(t) == len(s) + 1 and 1 <= len(s) <= 10:
    print('Yes')
else:
    print('No')
s = input()
t = input()
if((c.islower() for c in s) and (d.islower() for d in t) and (s in t) and len(s) + 1 == len(t)):
  print("Yes")
else:
  print("No")
s=input()
t=input()
l=len(s)
m=len(t)
flag=0
for i in range(0,l):
    if s[i]==t[i]:
        flag=1
    else:
        break
if flag==1:
    print("Yes")
else:
    print("No")
list = [input() for i in range(2)]

s = list[0]
t = list[1]
lens = len(s)
lent = len(t)
if s in t and lent-lens==1 and 1<=lens<=10:
  print("Yes")
else:
  print("No")
#---------------
#  argv.py
#---------------
import sys

# コマンドライン引数を変数argsに代入
args = sys.argv

print(args)
s = str(input())
t = str(input())

if 1 <= len(s) <= 10 and len(t)==len(s) + 1 and s in t :
    print("Yes")
else:
    print("No")
s = input()
t = input()
if s[0:-1] == t[0:-2]:
    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[-2]==s:
    print('Yes')
    
else:
    print('No')
s=input()
t=input()
l=len(t)-1
if l==len(s) and s==t[0:l]:
  print("YES")
else:
  print("NO")
a = input()
e = input()
b = len(a)
f = 0
for i in range(b) :
    c = a[i]
    d = e[i]
    if not c == d :
        print("No")
        f = 1
if f == 0 :
    print("Yes")
S = str(input())
T = str(input())
if T != S[-1]:
    print("Yes")
else:
    print("No")
import sys

s = input()
t = input()

for i in range(len(s)):
  if s[i] != t[i]:
    print('false')
    sys.exit()
else:
  print('true')
a=list(input())
b=list(input())
a.append(b[-1])
print(a,b)
if a==b:
    print("Yes")
else:
    print("No")
from sys import *
def test(s,t):
	for i,j in zip(s,t):

		if i != j:
			return "No"
	return "Yes"


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

    else:
        print('No')


resolve()
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()
cond = (1 <= len(S) <= 10) and len(S) == len(T) - 1
print('Yes' if cond else 'No')
s = input()
t = input()

t = t.rstrip(t[len(t)-1])

if(s == t):
    print("yes")
else:
    print("no")
S = input()
T = input()

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

if Slen == (Tlen -1) and S[0:Slen-1] == T[0:Slen-1]:print("Yes")
else: print("No")
n = list(input())
m = list(input())

if n == m[0:-2]:
    print("Yes")
else:
    print("No")
s = input()
t = input()

if s in t and s < t and len(s) <= 10:
    print("Yes")
else:
    print("No")
A = input()
B = input()
C = B[:len(B)-2]
if A == C:
  D = "Yes"
else:
  D = "No"
print(D)
s = input()
t = input()

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

if 1 <= len(S) <= 10 and len(T) == len(S) + 1:
    print('Yes')
else:
    print('No')
s = input()
t = input()
if s == t[:len(t)]:
  print('Yes')
else:
  print('No')
# 問題A
s = input()
t = input()
if s+t[-1] == t:
    print('Yes')
else:
    print('NO')
S = str(input())
T = str(input())

same_l = min(len(S), len(T))
# print(S[:same_l-1])
# print(T[:same_l-1])

if S[:same_l-1] == T[:same_l-1]:
    # print("t")
    if len(T)-len(S) == 1:
        print("Yes")
    else:
        print("No")
else:
    print("No")
S = input()
T = input()
while len(S) > 10:
    S = input('Sは: ')
while len(T) != len(S) + 1:
    T = input('Tは: ')
if S in T and S != T:
    print('Yes')
elif S not in T or S == T:
    print('No')
S = input("Enter words: ")
T = input("Enter another words: ")

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

if S in T:
    print("Yes")
else:
    print("No")
# -*- coding: <encoding name> -*-
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


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


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

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

if (S == T[:s]) & (t == s+1):
    print("yes")
else:
    print("no")
s = input()
t = input()
list = ["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"]
if 1 <= len(s) <= 10 and len(t)-len(s)==1:
    for i in list:
        if s+i==t:
            print("Yes")
            break
else:
    print("No")
s = input();
t = input();
ls = len(s);
lt = len(t);
if(ls == (lt - 1)):
    print("Yes");
else:
    print("No");
# A - Registration
def main():
    S, T = open(0).read().split()
    print("Yes" if T[:-1] == S else "No")
    print(T[:-1])


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

if S == T[:len(T)-1] and len(S) == len(T) - 1:
    print("Yse")
else:
    print("No")
#!/usr/bin/env python
"""AtCoder Beginner Contest 167: A - 
https://atcoder.jp/contests/abc167/tasks/abc167_a
"""

__author__ = 'bugttle <bugttle@gmail.com>'


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 T.startswith(S):
    if len(T) == (len(S) + 1):
        print('YES')
else:
    print('No')
S = input()
T = input()

add = len(T)
#print(add)
if len(S) > 10 or len(S) < 2:
  print("No")
  exit()

if S != T[:int(len(T)-1)]:
  print("No")
  exit()
if len(S)+1 != len(T):
  print("No")
  exit()
for i in range(len(T)):
  if T[i] not in "abcdefghijklmnopqrstuvwxyz":
    print("No")
    exit()
  else:
    pass

print("yes")
s = input()
t = input()

print(s)
print(t[0:-1])

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

if len(T) == len(S) + 1:
    if T.startswith(S):
        print('Yes')
else:
    print('No')
import sys
input = sys.stdin.readline
import numpy as np

a = [input() for i in range(3)]
# print(a)
# print(T[:-1])

s_len = len(a[0])
a[0] = a[0].rstrip('\n')


if a[0] == a[1][:-1]:
    print('Yes')
else:
    print('No')
s=input()
t=input()
a=len(s)
b=len(t)
m=s[0:-1]
if (m!=s):
 print("No")
elif (b-a>1):
 print("No")
else:
 print("Yes")
first = input()
second = input()

if(second.find(first) >= 0 and len(second) == len(first) + 1):
  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()

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

if S in T:
    T = T.strip(S)
    if len(T) == 1:
        print('Yes')
    else:
        print('No')
else:
    print('No')
s = input()
t = input()

if s.startswith(t):
  print("Yes")
else:
  print("No")
#x,y = map(int,input().split())
#arr = [int(i) for i in input().split()]
from collections import Counter
import math
mod = 10**9+7


s1 = input()
s2 = input()
flag = 0
s1 += s2[len(s2)-1]
if s1 == s2:
	print("YES")
else:
	print("NO")
import sys
input = sys.stdin.readline
import numpy as np

a = [input() for i in range(2)]

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

ans = True

if len(a)+1 != len(b):
  ans = False
else:
  for i in range(len(a)-1):
    if a[i] != b[i]:
      ans = False
      break

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

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

if s in t:
  print('Yes')
else:
  print('No')
a=input()
b=input()

z=b[:-1]

if a==b:
    print('Yes')
else:
    print('No')
s = input()
t = input()
if s+"z" ==t:
    print("Yes")
else:
    print("No")
S=input()
T=input()
if S in T:
    print("Yes")
else:
    print("No")
S = input()
T = input()

if len(S) + 1 == len(T):
    print('Yes')
else:
    print('No')
# -*- coding: utf-8 -*-

S = input()
T = input()

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


if t in s and s1 == s2:
	print('Yes')
else:
	print('No')
s = set(input())
t = set(input())

if len(t-s) == 1:
    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==1:
  print("NO")
else:
  print("YES")
S = input()
T = input()

S = str(S)
T = str(T)
def register(S, T):
	
    if (1 <= len(S) <= 10 and len(T) == len(S) + 1) and (S[0: len(S) - 1] == T[0: len(S) - 1]):
        print("Yes")
    else:
        print("No")
         
register(S, T)
S = input()
T = input()
if S in T:
	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 = list(input())
t = list(input())

ans = 'Yes'

for i in range(1,len(s)):
    if s[i]  != t[i]:
        ans = 'No'

print(ans)
s = input()
t = input()

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

if t.startswith(s):
    print("YES")
else:
    print("NO")
S = input()
T = input()
if S[0:len(T) - 1] == S:
  print("Yes")
else:
  print("No")
S = input()
T = input()
t = len(T)
T = T.strip(T[t-1])
if S == T:
  print('Yes')
else:
  print('No')
import re
S = input()
T = input()
T = T.replace(S,'',1)
T = re.sub('[a-z]','',T)
if T == "":
    print('Yes')
else:
    print('No')
s =input()
t =input()

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

if s == t[:(len(s)-2)]:
  print("Yes")
else :
  print("No")
S = input()
T = input()
flag = S.isalpha() * T.isalpha() * S.islower() * T.islower()

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

if S in T:
    T = T.replace(S, '', 1)
    if len(T) == 1:
        print('Yes')
    else:
        print('No')
else:
    print('No')
s = input()
s2 = input()

s3=s2[:-1]
print(s3)
if len(s)+1 == len(s2) and s in s3:
    print('Yes')
else:
    print('No')
S = input()
T = input()
if len(S) == len(T)+1 and S == T[:len(S)-1]:
  print("Yes")
else:
  print("No")
# -*- coding: utf-8 -*-

S=list(input())
T=list(input())
F=0
for i in range(len(S)):
    if  S[i]==T[i]:

        if len(T)==len(S)+1:
            F=1

if F==1:
    print("Yes")

if F==0:
    print("No")
S = list(input())
T = list(input())
cnt = 0
for i in range(len(S)):
  if S[i] == T[i]:
    continue
  else:
    print('No')
    cnt = 1
if cnt == 0:
  print('Yes')
S = input()
T = input()

T = T.rstrip(T[len(T)-1])
if S == T:
    print("Yes")
else:
    print("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()

if s in t:
  print("Yes")
else:
  print("No")
s=input()
t=input()
if len(t)>len(s)+1:
    print("NO")
elif s[0:len(t)]==t[0:len(t)-1]:
    print("YES")
else:
    print("NO")
s = input()
t = input()
tlen = len(t)
slen = len(s)
 
if tlen > 10 or tlen != slen + 1:
    print("No")
elif t[:-1] != s:
    print("No")
else:
    print("Yes")
S = input()
T = input()
if(S in T):
  print('Yes')
else:
  print('No')
s = input()
t = input()
if s in t:
    print("Yes")
else:
    print("No")
S = input()
T = input()
X = int(len(T)) - 1

if (S in T) and X == int(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")
originalName = input()
modifiedName = input()
if originalName in modifiedName and len(modifiedName) > len(originalName):
    print('Yes')
else:
    print('No')
import itertools
import math
from collections import defaultdict

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

def solve():
    s = input()
    t = input()
    print('Yes' if s[:len(t)] == t else 'No')

if __name__ == '__main__':
    solve()
s=input()
st=input()
if s in st:
    print("Yes")
else:
    print("No")
S = input()
T = input()

add = len(T)
#print(add)

if S != T[:int(len(T)-1)]:
  print("No")
  exit()
if len(S)+1 != len(T):
  print("No")
  exit()
for i in range(len(T)-1):
  if T[i] not in "abcdefghijklmnopqrstuvwxyz":
    print("No")
    exit()
  else:
    pass

print("yes")
import sys

s = sys.stdin.readline()
t = sys.stdin.readline()

if s == t[::-1]:
  print('Yes')
else:
  print('No')
n = list(map(str,input()))
m = list(map(str,input()))
# 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 s in t and len(t) == len(s) + 1 and 1 <= len(s) <= 10:
  print('Yes')
else:
  print('No')
s = input()
t = input()

if s in t:
    print('Yes')
else:
    print('No')
s=str(input())
t=str(input())
z=len(s)
result=0
for i in s:
    for h in t:
        if i==h:
            continue
        else:
            result+=1
if result<=1:
    print('Yes')
else:
    print('No')
s = list(input().split())
t = list(input().split())

n_s = len(s)
ans = 0

for i in range(n_s):
    if t[i] == s[i]:
        ans += 1
if ans == n_s:
    print('Yes')
else:
    print('No')
S = input()
T = input()
condition = True
if len(T)!= len(S)+1 :
  condition = False
for i in range(len(S)):
  if S[i] !=T[i]:
    condition = False
if condition:
  print("YES")
else:
  print("NO")
s = input()
t = input()
t = t.replace(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()
st=input()
if s in st and int(len(st))-int(len(s))==1:
    print("Yes")
elif s in st and int(len(st))-int(len(s))!=1:
    print("No")
else:
    print("No")
n = list(map(str,input()))
m = list(map(str,input()))
# m = str(input())
if n[:] == m[:-1]:
    print('yes')
else:
    print('No')
s = input()
t = input()

ans = "No"

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

if s in t and len(s)==len(t)-1:
  print('Yes')
else:
  print('No')
s = input()
t = input()
if len(t)-len(s) == 1 and t[0:len(s)] == s:
    print("Yse")
else:
    print("No")
x = input()
y = input()
 
if len(x) > 10:
  print('No')
elif len(y) - len(x) != 1:
  print('No')
elif x.islower() ==False or x.isalpha() != True:
  print('No')
else:
  print('Yes')
s=input()
t=input()
l=len(t)
print('Yes' if s in t[:l] else 'No')
S = input()
T = input()

if len(T) == 2 and T[0] == T[1]:
    print("Yes")
else:
    T = T.replace(S,"")
    if len(T)==1 and T.islower()==True:
        print("Yes")
    else:
        print("No")
a=input()
b = input()
if a[0:-1] == b[0:-2]:
    print('Yes')
else:
    print('No')
#!/usr/bin/env python3
# -*-coding: utf-8-*-

s = input()
t = input()

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