import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))

import math;floor,ceil=lambda x:int(math.floor(x)),lambda x:int(math.ceil(x))

from functools import reduce;gcd=lambda*x:reduce(math.gcd,x);lcm=lambda*x:reduce(lambda x,y:(x*y)//gcd(x,y),x,1)

from collections import deque

Yes=lambda b:print("Yes"if b else"No");YES=lambda b:print("YES"if b else"NO")

is_even=lambda x:True if x%2==0 else False



def main():

  s=input()

  t=input()

  n=len(s)

  flg=0

  for i in range(n):

    if s[i]!=t[i]:

      flg=1

  Yes(flg==0)



    

if __name__ == '__main__':

    main()

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

Yes=lambda b:print("Yes"if b else"No")



s,t=input(),input()

Yes(s==t[:-1])

import sys

input = lambda: sys.stdin.readline().rstrip()
aint = lambda: int(input())
ints = lambda: list(map(int, input().split()))
import math

floor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x))
from functools import reduce

gcd = lambda *x: reduce(math.gcd, x)
lcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1)
from collections import deque

Yes = lambda b: print("Yes" if b else "No")
YES = lambda b: print("YES" if b else "NO")
is_even = lambda x: True if x % 2 == 0 else False


def main():
    s = input()
    t = input()
    n = len(s)
    flg = 0
    for i in range(n):
        if s[i] != t[i]:
            flg = 1
    Yes(flg == 0)


if __name__ == "__main__":
    main()

import sys

input = lambda: sys.stdin.readline().rstrip()
Yes = lambda b: print("Yes" if b else "No")
s, t = input(), input()
Yes(s == t[:-1])

-aint = lambda: int(input()) -ints = lambda: list(map(int, input().split())) -import math - -floor, ceil = lambda x: int(math.floor(x)), lambda x: int(math.ceil(x)) -from functools import reduce - -gcd = lambda *x: reduce(math.gcd, x) -lcm = lambda *x: reduce(lambda x, y: (x * y) // gcd(x, y), x, 1) -from collections import deque - -YES = lambda b: print("YES" if b else "NO") -is_even = lambda x: True if x % 2 == 0 else False - - -def main(): -    s = input() -    t = input() -    n = len(s) -    flg = 0 -    for i in range(n): -        if s[i] != t[i]: -            flg = 1 -    Yes(flg == 0) - - -if __name__ == "__main__": -    main() +s, t = input(), input() +Yes(s == t[:-1])