a=set(input()) b=set(input()) matched_list = list(a & b) if len(a)==len(matched_list): print("YES") else: print("NO")