A = input() B = input() k=0 for i in A: if i not in B: k += 1 if k == 0: print("YES") else: print("NO")