a = input()
b = input()
judge = "YES"

for i in range(len(a)):
    if a[i] not in b:
        judge = "NO"
        break
    
print(judge)