A = input() B = input() cnt=0 for i in B: if i in A: cnt+=1 else: break if len(A) == cnt: print("YES") else: print("NO")