A,B=input(),input() flg = True for c in A: if c not in B: flg = False break if flg:print("YES") else:print("NO")