a=input() b=input() c=0 for i in a: if i in b: c+=1 if len(a)==c: print("YES") else: print("NO")