A = input() B = input() for i in A: if i not in B: print("NO") break else: print("YES")