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